Giter Club home page Giter Club logo

Comments (21)

nanjizal avatar nanjizal commented on May 27, 2024 2

Try moving the folder usr/local/include/ . Sorry not tried HL recently so only a guess based on quick google.

from hashlink.

madneon avatar madneon commented on May 27, 2024 1

I'm getting similar error on Ubuntu 16.04
libs/fmt/fmt.c:6:31: fatal error: vorbis/vorbisfile.h: No such file or directory

from hashlink.

ncannasse avatar ncannasse commented on May 27, 2024

I have not worked a lot on OSX/Linux support so it might take a few more weeks until I can get to it.

from hashlink.

boozook avatar boozook commented on May 27, 2024

I think some things should be fixed for (including for macOS):

  1. I'm not sure why need OpenAL-soft on mac because macOS provides OpenAL.framework. (typically there: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/OpenAL.framework/)

I patched makefile and build hl fine.

# Mac
LIBEXT=dylib
# INCLUDES:
CFLAGS += -m$(ARCH)
CFLAGS += -I /opt/libjpeg-turbo/include -I /usr/local/Cellar/jpeg-turbo/1.5.1/include -I $(brew --prefix)/opt/libjpeg-turbo/ -I /usr/local/opt/jpeg-turbo/include
CFLAGS += -I /usr/local/include
CFLAGS += -I /usr/local/opt/libvorbis/include -I /usr/local/Cellar/libvorbis/1.3.5/include -I $(brew --prefix)/opt/libvorbis/include
CFLAGS += -I /usr/local/opt/openal-soft/include -I /usr/local/Cellar/openal-soft/1.17.2/include -I $(brew --prefix)/opt/openal-soft/include
LFLAGS += -Wl,-export_dynamic -L/usr/local/lib
# LIBS:
# LIBFLAGS += -L/opt/libjpeg-turbo/lib
LIBFLAGS += -L/usr/local/Cellar/jpeg-turbo/1.5.1/lib -L/usr/local/opt/jpeg-turbo/lib -L/usr/local/lib -L/usr/local/opt/libvorbis/lib -L/usr/local/Cellar/libvorbis/1.3.5/lib -L/usr/local/opt/openal-soft/lib -L/usr/local/Cellar/openal-soft/1.17.2/lib
LIBOPENGL = -framework OpenGL
LIBOPENAL = -framework OpenAL
LIBSSL = -framework Security -framework CoreFoundation
  1. Yet I can't build Haxe-HL-generated hello-world.c
clang -o main -D INCLUDE_ALL -std=c11 out/test/main.c -Lhl -I hl -I ~/hashlink/include -L~/hashlink -L~/hashlink/libs
out/test/main.c:2:10: error: 'hl/code.h' file not found with <angled> include; use "quotes" instead
#include <hl/code.h>
         ^~~~~~~~~~~
         "hl/code.h"
In file included from out/test/main.c:2:
out/test/hl/code.h:6:10: fatal error: 'hlc.h' file not found
#include <hlc.h>
         ^
2 errors generated.
  1. Okay, hl was built with make all ARCH=64. Trying hl out/test/main.hl.
    HL/JIT is currently not supported when compiled to 64 bits, use make ARCH=32 to compile to 32 bits - It's sad but ok, trying to build for 32bit arch:

make all ARCH=32

...
cc -Wall -O3 -I src -msse2 -mfpmath=sse -std=c11 -I include/pcre -D LIBHL_EXPORTS -m32 -I /opt/libjpeg-turbo/include -I /usr/local/Cellar/jpeg-turbo/1.5.1/include -I /opt/libjpeg-turbo/ -I /usr/local/opt/jpeg-turbo/include -I /usr/local/include -I /usr/local/opt/libvorbis/include -I /usr/local/Cellar/libvorbis/1.3.5/include -I /opt/libvorbis/include -I /usr/local/opt/openal-soft/include -I /usr/local/Cellar/openal-soft/1.17.2/include -I /opt/openal-soft/include -o hl src/callback.o src/code.o src/jit.o src/main.o src/module.o src/debugger.o -L. -lhl -Wl,-export_dynamic -L/usr/local/lib -ldl
ld: warning: ignoring file src/callback.o, file was built for x86_64 which is not the architecture being linked (i386): src/callback.o
ld: warning: ignoring file src/code.o, file was built for x86_64 which is not the architecture being linked (i386): src/code.o
ld: warning: ignoring file src/jit.o, file was built for x86_64 which is not the architecture being linked (i386): src/jit.o
ld: warning: ignoring file src/main.o, file was built for x86_64 which is not the architecture being linked (i386): src/main.o
ld: warning: ignoring file src/module.o, file was built for x86_64 which is not the architecture being linked (i386): src/module.o
ld: warning: ignoring file src/debugger.o, file was built for x86_64 which is not the architecture being linked (i386): src/debugger.o
Undefined symbols for architecture i386:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [hl] Error 1

What i'm doing wrong?

from hashlink.

Justinfront avatar Justinfront commented on May 27, 2024

Hi fizzr the cmake file seems to be setup to compile all 32 bit - if you have universal versions of dependancies and have recursed submodules when checking out, I think you would get further, ie to runtime errors rather than build errors?
I was having problems with cmodules.c not really fully setup for mac but only windows, but not much idea when it comes to c/c++.
Really think the cmake approach is more robust on mac, I believe this since I presume it's the preferred travis approach and why Andy added it. On the normal 'make' approach the dependancies don't seem too pick up the 32 bit versions, not too sure why, but the cmake seems to check for useable 32bit dependancies and let you know if you have them, did you try cmake approach?

from hashlink.

boozook avatar boozook commented on May 27, 2024

@Justinfront Thank you.
cmake hashlink

-- The C compiler identification is AppleClang 8.0.0.8000042
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found SDL2: /Library/Frameworks/SDL2.framework;-framework Cocoa  
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework  
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.8") 
-- Found PNG: /usr/local/lib/libpng.dylib (found version "1.4.12") 
-- Performing Test TURBOJPEG_WORKS
-- Performing Test TURBOJPEG_WORKS - Success
-- Found TurboJPEG: /usr/local/opt/jpeg-turbo/lib/libturbojpeg.dylib  
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ak/Repositories/hashlink

next make all

Scanning dependencies of target fmt.hdll
[ 73%] Building C object CMakeFiles/fmt.hdll.dir/libs/fmt/fmt.c.o
/Users/ak/Repositories/hashlink/hashlink/libs/fmt/fmt.c:6:10: fatal error: 'vorbis/vorbisfile.h' file not found
#include <vorbis/vorbisfile.h>
         ^
1 error generated.
make[2]: *** [CMakeFiles/fmt.hdll.dir/libs/fmt/fmt.c.o] Error 1
make[1]: *** [CMakeFiles/fmt.hdll.dir/all] Error 2
make: *** [all] Error 2

It because as brew said "Warning: libvorbis: this formula has no --universal option so it will be ignored!". Okay, trying to build vorbis by hands...

from hashlink.

tanis2000 avatar tanis2000 commented on May 27, 2024

@fzzr- I'm experiencing the same issue with hashlink on macOS. It looks like the find_package() can't actually find the includes of libvorbis. Did you manage to find a solution?

UPDATE
Actually it's a broader problem. If you installed libvorbis through homebrew you have to manually add to the CMakeLists.txt the /usr/local/include path. I don't know why it's not being picked up by default by CMake.

The piece of code I changed is the following:

target_include_directories(fmt.hdll
	PRIVATE
	${ZLIB_INCLUDE_DIRS}
	${PNG_INCLUDE_DIRS}
	${TurboJPEG_INCLUDE_DIRS}
    ${OGGVORBIS_INCLUDE_DIR}
    /usr/local/include
)

Still, I need to find a way to pass the ARCH=32 to CMake or make as both seem to ignore the environment variable.

UPDATE 2

I added set (CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS}") to my CMakeLists.txt to force 32 bit compilation. Now the problem is that the libraries like libogg and libvorbis are x86_64 only and homebrew doesn't support building them from source as fat binaries. Has anyone found a solution to this?
I guess the best would be to just make hashlink work in full 64bit mode, but I have no idea how to do that or how to help. Any suggestion is appreciated :)

from hashlink.

andyli avatar andyli commented on May 27, 2024

Compiling 64-bit hashlink in Mac simply works. No need to modify the CMakeLists.txt. You just have to install the right dependencies using homebrew. Check how we do it in Travis: https://travis-ci.org/HaxeFoundation/hashlink/jobs/263221993

Compiling 32-bit hashlink in Mac is difficult, due to the various dependencies. I'm not sure if it is worthy to support, so unless Nicolas find an easy way to do it, I will just assume we will not support building 32-bit hashlink in Mac.

from hashlink.

tanis2000 avatar tanis2000 commented on May 27, 2024

@andyli the actual problem is that hashlink JIT expects everything to be 32 bit, not the other way around. Hence the problem on macOS as the default is 64 bit.
It's a known issue and a showstopper on macOS: #36

from hashlink.

boozook avatar boozook commented on May 27, 2024

@andyli

You just have to install the right dependencies using homebrew

Not for for all macs and arches. Try to build it on the MacBook Air (2.13 GHz Intel Core 2 Duo, Late 2010) with Sierra 10.12.4 (16E195). And required universal libvorbis from ports only.

from hashlink.

tanis2000 avatar tanis2000 commented on May 27, 2024

@andyli what's needed to port the JIT to 64 bit? Any way to help with that?

from hashlink.

andyli avatar andyli commented on May 27, 2024

what's needed to port the JIT to 64 bit?

See #36. (and I think only Nicolas can answer)

from hashlink.

ncannasse avatar ncannasse commented on May 27, 2024

I think we're all good now with x64 support. Please try again with HashLink 1.4 available here if you had issues in the past https://github.com/HaxeFoundation/hashlink/releases

from hashlink.

nanjizal avatar nanjizal commented on May 27, 2024

make all ARCH=64

ld: warning: ignoring file /usr/local/lib/libhl.dylib, file was built for i386 which is not the architecture being linked (x86_64): /usr/local/lib/libhl.dylib
Undefined symbols for architecture x86_64:
"_hl_alloc_buffer", referenced from:
_fmt_inflate_init in fmt.o
_zlib_error in fmt.o
_fmt_deflate_init in fmt.o
"_hl_alloc_dynamic", referenced from:
_fmt_inflate_init in fmt.o
_zlib_error in fmt.o
_fmt_deflate_init in fmt.o
"_hl_buffer_char", referenced from:
_zlib_error in fmt.o
"_hl_buffer_content", referenced from:
_fmt_inflate_init in fmt.o
_zlib_error in fmt.o
_fmt_deflate_init in fmt.o
"_hl_buffer_cstr", referenced from:
_fmt_inflate_init in fmt.o
_zlib_error in fmt.o
_fmt_deflate_init in fmt.o
"_hl_buffer_val", referenced from:
_fmt_inflate_init in fmt.o
_zlib_error in fmt.o
_fmt_deflate_init in fmt.o
"_hl_error_msg", referenced from:
_fmt_png_decode in fmt.o
_fmt_zip_flush_mode in fmt.o
_fmt_inflate_buffer in fmt.o
_fmt_deflate_buffer in fmt.o
_fmt_digest in fmt.o
"_hl_gc_alloc_gen", referenced from:
_fmt_inflate_init in fmt.o
_fmt_deflate_init in fmt.o
_fmt_ogg_open in fmt.o
"_hl_throw", referenced from:
_fmt_inflate_init in fmt.o
_zlib_error in fmt.o
_fmt_deflate_init in fmt.o
"_hl_to_utf8", referenced from:
_fmt_digest in fmt.o
"_hlt_abstract", referenced from:
_fmt_inflate_init in fmt.o
_fmt_deflate_init in fmt.o
_fmt_ogg_open in fmt.o
"_hlt_bytes", referenced from:
_fmt_inflate_init in fmt.o
_zlib_error in fmt.o
_fmt_deflate_init in fmt.o
"_hlt_i32", referenced from:
_fmt_inflate_init in fmt.o
_zlib_error in fmt.o
_fmt_deflate_init in fmt.o
ld: symbol(s) not found for architecture x86_64

make clean
make all ARCH=32

ld: warning: ignoring file /usr/local/lib/libpng.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libpng.dylib
ld: warning: ignoring file /usr/local/lib/libvorbisfile.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libvorbisfile.dylib
Undefined symbols for architecture i386:
"_hlt_abstract", referenced from:
_fmt_inflate_init in fmt.o
_fmt_deflate_init in fmt.o
_fmt_ogg_open in fmt.o
"_ov_clear", referenced from:
_ogg_finalize in fmt.o
"_ov_info", referenced from:
_fmt_ogg_info in fmt.o
"_ov_open_callbacks", referenced from:
_fmt_ogg_open in fmt.o
"_ov_pcm_seek", referenced from:
_fmt_ogg_seek in fmt.o
"_ov_pcm_tell", referenced from:
_fmt_ogg_tell in fmt.o
"_ov_pcm_total", referenced from:
_fmt_ogg_info in fmt.o
"_ov_read", referenced from:
_fmt_ogg_read in fmt.o
"_png_image_begin_read_from_memory", referenced from:
_fmt_png_decode in fmt.o
"_png_image_finish_read", referenced from:
_fmt_png_decode in fmt.o
"_png_image_free", referenced from:
_fmt_png_decode in fmt.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [fmt] Error 1

Please confirm the current brew requirements commands required. Is it built for mac with travis?

from hashlink.

boozook avatar boozook commented on May 27, 2024

@nanjizal

Is it built for mac with travis?

No, on my mb air.

from hashlink.

nanjizal avatar nanjizal commented on May 27, 2024

I think you should reopen this -
Untill travis is setup for mac with heaps tests, and stop using brew and move to submodules.

I say this with memories of nekonme, but feel free to ignore me, but if HL is not easy on a mac it will effect Heaps as well, Unity is very simple on a mac, HL needs to be as well supported?

from hashlink.

ncannasse avatar ncannasse commented on May 27, 2024

@nanjizal did you make clean/uninstall before ? it seems you have a 32bit libhl somewhere that messes things up.

from hashlink.

hunttis avatar hunttis commented on May 27, 2024

Urgh, it's super annoying that hashlink built fine on my work computer, but not my home computer. Only difference between these macs is that work computer is 2018 and home computer is 2016. I'm sure I've somehow mucked up the installed dependencies on my home computer.

The error I'm getting is:

In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h:27:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h:28:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
/usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
#       error Never include this file directly. Use <lzma.h> instead.
        ^
/usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
        lzma_check check;
        ^
/usr/local/include/Block.h:148:2: error: unknown type name 'lzma_vli'
        lzma_vli compressed_size;
        ^
/usr/local/include/Block.h:172:2: error: unknown type name 'lzma_vli'
        lzma_vli uncompressed_size;
        ^
/usr/local/include/Block.h:200:2: error: unknown type name 'lzma_filter'
        lzma_filter *filters;
        ^
/usr/local/include/Block.h:217:20: error: use of undeclared identifier 'LZMA_CHECK_SIZE_MAX'
        uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
                          ^
/usr/local/include/Block.h:231:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int3;
        ^
/usr/local/include/Block.h:232:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int4;
        ^
/usr/local/include/Block.h:233:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int5;
        ^
/usr/local/include/Block.h:234:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int6;
        ^
/usr/local/include/Block.h:235:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int7;
        ^
/usr/local/include/Block.h:236:2: error: unknown type name 'lzma_vli'
        lzma_vli reserved_int8;
        ^
/usr/local/include/Block.h:237:2: error: unknown type name 'lzma_reserved_enum'
        lzma_reserved_enum reserved_enum1;
        ^
/usr/local/include/Block.h:238:2: error: unknown type name 'lzma_reserved_enum'
        lzma_reserved_enum reserved_enum2;
        ^
/usr/local/include/Block.h:239:2: error: unknown type name 'lzma_reserved_enum'
        lzma_reserved_enum reserved_enum3;
        ^
/usr/local/include/Block.h:240:2: error: unknown type name 'lzma_reserved_enum'
        lzma_reserved_enum reserved_enum4;
        ^
/usr/local/include/Block.h:261:2: error: unknown type name 'lzma_bool'
        lzma_bool ignore_check;
        ^
/usr/local/include/Block.h:263:2: error: unknown type name 'lzma_bool'
        lzma_bool reserved_bool2;
        ^
/usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
        lzma_bool reserved_bool3;
        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [libs/ssl/ssl.o] Error 1```

Any tips? I did try make clean and make uninstall before as well.

from hashlink.

hunttis avatar hunttis commented on May 27, 2024

Thank you! I renamed it to something else, created a new include-directory and reinstalled the bundle and it compiles now!

Cheers!

from hashlink.

nanjizal avatar nanjizal commented on May 27, 2024

Can you upload them I presume they should work here would be curious to try them I presume your using lastest preview haxe. Hate all that building libraries.

from hashlink.

hunttis avatar hunttis commented on May 27, 2024

Ok, try this.. You should be able to use the make install command when you uncompress this. Or alternatively you can just drop the contents of this zip into a folder you have the hashlink sources cloned into and use make install. Not very experienced with the install scripts, but I tried to see what it wants.

And yeah, I'm using RC1 of haxe.

http://huntt.is/files/hashLink-compiled.zip

from hashlink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.