halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.85k stars 1.07k forks source link

Porting Halide to FreeBSD #3655

Open shamazmazum opened 5 years ago

shamazmazum commented 5 years ago

Hello. I want to port Halide 2018/02/15 release to FreeBSD. I am trying to compile Halide with cmake on FreeBSD 12.0 After making some trivial changes to src/Target.cpp and src/LLVM_Runtime_Linker.cpp I almost succeeded to compile it, but got the following error:

Scanning dependencies of target bilateral_grid_process
[ 87%] Building CXX object apps/bilateral_grid/CMakeFiles/bilateral_grid_process.dir/filter.cpp.o
[ 87%] Linking CXX executable ../../bin/bilateral_grid_process
/usr/bin/ld: error: undefined symbol: dispatch_get_global_queue
>>> referenced by posix_allocator.cpp
>>>               halide_rt_host.a.o:(halide_default_do_par_for) in archive ../.././genfiles/halide_rt_host/halide_rt_host.a

/usr/bin/ld: error: undefined symbol: dispatch_apply_f
>>> referenced by posix_allocator.cpp
>>>               halide_rt_host.a.o:(halide_default_do_par_for) in archive ../.././genfiles/halide_rt_host/halide_rt_host.a
c++: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make[2]: stopped in /home/vasily/test/Halide-release_2018_02_15/build
*** Error code 1

Stop.
make[1]: stopped in /home/vasily/test/Halide-release_2018_02_15/build
*** Error code 1

Stop.
make: stopped in /home/vasily/test/Halide-release_2018_02_15/build

dispatch_get_global_queue is in /usr/local/lib/libdispatch.so, but, I think, cmake does not look into /usr/local/lib for libraries because this location is also BSD-specific (e.g. Linux installs libraries at /usr/lib). Halide's building rules are hard for me to understand. Can anyone help me to add correct compiler/linker arguments to fix this problem?

Martinfx commented 4 years ago

@shamazmazum We have the next problem with this platform https://github.com/halide/Halide/issues/4318

alexreinking commented 4 years ago

None of the current contributors use BSD or have the ability to support it. That said, contributions are welcome, here!