LKedward / focal

A modern Fortran abstraction layer for OpenCL
https://lkedward.github.io/focal-docs
MIT License
40 stars 8 forks source link

Build issues on MacOS #17

Open Nicholaswogan opened 2 years ago

Nicholaswogan commented 2 years ago

Make compilation fails on Apple Silicon:

gfortran -std=f2008 -fimplicit-none -J../mod/ -g -Og -C -Wall -fbounds-check -fbacktrace -ffpe-trap=invalid,zero,overflow  -c Focal_Test_Utils.f90 -o ../obj/Focal_Test_Utils.o
gfortran -std=f2008 -fimplicit-none -J../mod/ -g -Og -C -Wall -fbounds-check -fbacktrace -ffpe-trap=invalid,zero,overflow  -c testExample.f90 -o ../obj/testExample.o
mkdir build_testExample_cl
cp testExample.cl build_testExample_cl/fclKernels.cl
cd build_testExample_cl; ld -r -b binary fclKernels.cl -o ../../obj/testExample.cl.o; rm fclKernels.cl
ld: warning: option -b is obsolete and being ignored
ld: file not found: binary
rm -rf build_testExample_cl
gfortran ../obj/testExample.o ../obj/testExample.cl.o ../obj/Focal_Test_Utils.o -L../lib -lFocaldbg -g -L/usr/lib/ -lOpenCL -o ../bin/testExample
ld: file not found: ../obj/testExample.cl.o
collect2: error: ld returned 1 exit status
make[1]: *** [../bin/testExample] Error 1
make: *** [test] Error 2

Looks like ld is being used in an obsolete way in the make file.

Would be really great to have a platform independent build system for this project like CMake. I see the other related issue #14 .