Make sure to have the environment variable ALGENCAN_LIB
properly configured, such as below.
export ALGENCAN_LIB=/opt/algencan/lib/
cd c/
gcc -O3 main.c -L${ALGENCAN_LIB} -lalgencan -lgfortran -lm -o algencan
./algencan
cd cpp/
g++ -O3 main.cpp -L${ALGENCAN_LIB} -std=c++20 -lalgencan -lgfortran -lm -o algencanpp
./algencan
When using CMake, there is no need for setting the environment variable ALGENCAN_LIB
,
since the FindALGENCAN
will load it automatically.
cd cmake/
mkdir build
cd build
cmake ..
make
./main