prisms-center / CASMcode_clexulator

CASM `clexulator` library
Other
0 stars 4 forks source link

Encountering `undefined symbol: _ZTIN4CASM10clexulator14BaseClexulatorE` while trying to use `make_clexulator()` #25

Open seshasaibehara opened 3 months ago

seshasaibehara commented 3 months ago

You might encounter an error if you are using g++ compiler on linux and use it to compile a clexulator which reads:

-- Compiling: input_files/SiGe_Clexulator_default.cc -- 
compile time depends on how many basis functions are included
dlopen failed: input_files/SiGe_Clexulator_default.so: undefined symbol: _ZTIN4CASM10clexulator14BaseClexulatorE
Error compiling clexulator. To fix: 
  - Check compiler error messages.
  - Check compiler options with 'casm settings -l'
    - Update compiler options with 'casm settings --set-compile-options '...options...'
    - Make sure the casm headers can be found by including '-I/path/to/casm'
Clexulator construction failed: could not construct runtime library.

The way to fix it is to set the following environment variable before compiling the clexulator: export CASM_SOFLAGS=-shared -Wl,--no-as-needed