sandialabs / CACTUS

CACTUS (Code for Axial and Cross-flow TUrbine Simulation) is a turbine performance simulation code, based on a free wake vortex method, to study wind turbines and marine hydrokinetic (MHK) devices.
BSD 3-Clause "New" or "Revised" License
18 stars 12 forks source link

Compilation possible on macOS with ARM64 architecture? #56

Open yonghoonlee opened 1 year ago

yonghoonlee commented 1 year ago

I tried to compile using the conda-forge compilers toolchain, but it didn't work. What I tried was:

conda create -y --name cactus
conda activate cactus
conda install -c conda-forge compilers cmake
mkdir -p build
cd build
cmake ..
make

When I run cmake, I got the following output:

cmake ..
-- The Fortran compiler identification is GNU 11.3.0
-- Checking whether Fortran compiler has -isysroot
-- Checking whether Fortran compiler has -isysroot - yes
-- Checking whether Fortran compiler supports OSX deployment target flag
-- Checking whether Fortran compiler supports OSX deployment target flag - yes
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /Users/yhlee/conda/envs/cactus/bin/arm64-apple-darwin20.0.0-gfortran - skipped
-- The C compiler identification is Clang 14.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/yhlee/conda/envs/cactus/bin/arm64-apple-darwin20.0.0-clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for Fortran sgemm
-- Looking for Fortran sgemm - not found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Looking for Fortran dgemm
-- Looking for Fortran dgemm - found
-- Found BLAS: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework  
-- Looking for Fortran cheev
-- Looking for Fortran cheev - found
-- Found LAPACK: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework;-lm;-ldl  
-- Found OpenMP_C: -fopenmp=libomp (found version "5.0") 
-- Found OpenMP_Fortran: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "5.0")  
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/yhlee/Documents/CACTUS/build

However, when I try to make, I get following error message:

make          
[  1%] Building Fortran object CMakeFiles/cactus.dir/src/mod/airfoil.f90.o
arm64-apple-darwin20.0.0-gfortran: fatal error: no input files
compilation terminated.
/bin/sh: -O2: command not found
make[2]: *** [CMakeFiles/cactus.dir/src/mod/airfoil.f90.o] Error 127
make[1]: *** [CMakeFiles/cactus.dir/all] Error 2
make: *** [all] Error 2

When I checked the folder CMakeFiles/cactus.dir/src/mod/, there was no "airfoil.f90.o" file created there. However, I was able to still find the input file (../src/mod/airfoil.f90), and I also checked the content of the source code.

How can I resolve this problem? Thank you.

whophil commented 1 year ago

No solution here, but I also encounter this using the conda-forge compilers toolchain and x86_64 Python. So it seems this is a general problem of the CMakeLists.txt on Mac, not specific to ARM64.