PrincetonUniversity / tristan-mp-v2

Tristan-MP v2 [public]
https://princetonuniversity.github.io/tristan-v2/
BSD 3-Clause "New" or "Revised" License
12 stars 2 forks source link

CmakeLists.Txt file is missing #19

Open marc-shen opened 3 weeks ago

marc-shen commented 3 weeks ago

In version 2.8, although the cmake compilation scheme has been updated, the CMakeLists.txt file appears in the .gitignore listing. There's no way we can use cmake to do the compilation properly.

# preconfigure the code using
cmake -B build -D user=<USERFILE> -D dim=3 ...

This step requires the CMakeLists.txt file to be executed.

Error message:

% cmake -B build -D user=user_2d_rec.F90 -D dim=2
CMake Error: The source directory "/Users/username/program/GitHub/tristan-mp-v2" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
haykh commented 2 weeks ago

My bad, i forgot to add it to .gitignore. now should be available.

marc-shen commented 2 weeks ago

I have met some new problems.

COMPILE_FLAGS -mavx2

The compile flag -mavx2 is used on x86.

The Mac m1 is arm64, so that I have to remve the -mavx2 in CMakeLists.txt.

Undefined symbols for architecture arm64

% cmake --build build -j

ld: warning: -commons use_dylibs is no longer supported, using error treatment instead
Undefined symbols for architecture arm64:
  "___m_finalize_MOD_finalizeall", referenced from:
      _main in tristan.F90.o
  "___m_initialize_MOD_initializeall", referenced from:
      _main in tristan.F90.o
  "___m_mainloop_MOD_mainloop", referenced from:
      _main in tristan.F90.o
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status
make[2]: *** [src/tristan-v2.xc] Error 1
make[1]: *** [src/CMakeFiles/tristan-v2.xc.dir/all] Error 2
make: *** [all] Error 2

I'm not sure how to solve this problem. Perhaps the files produced by the compilation are not recognized properly, or the compilation order is wrong.