This project has some hardcoded path and case-sensitivity issues that prevent it from running "out of the box" on modern, case-sensitive Linux systems like Ubuntu. I will summarize below what I have found to work, in the most basic way possible.
-
Use a Linux system (like Ubuntu or WSL) with gfortran and cmake installed.
sudo apt update && sudo apt install gfortran cmake
-
Clone the repo and build the project using the README instructions.
git clone https://github.com/[user]/LWPC.git
cd LWPC
cmake -B build
cmake --build build
-
The program crashes because it can't find its data files. You must provide an absolute path in lwpcDAT.loc.
cd LWPCv21
pwd
Copy this output into the /LWPC/LWPCv21/lwpcDAT.loc file, replacing the string currently in there.
-
The code is hardcoded to look for lowercase directory names (lwpc, lwpcv21), but the repository uses uppercase (LWPC, LWPCv21). We can fix this by creating symbolic links (symlinks).
cd ../.. -> Gets you out of LWPC/LWPCv21 so you are in your base directory.
ln -s LWPC lwpc
cd LWPC
ln -s LWPCv21 lwpcv21
-
The example .inp files point to the wrong directory (assuming you haven't changed anything). Open an example like bearings.inp in /LWPC/LWPCv21 and change the file directories from ../output/ to ../LWPCv21/output. This must be done for any .inp files you want to run.
-
TEST the program by running an example .inp file by doing the following:
../build
./lwpc.bin ../LWPCv21/bearings
The program should run with no errors. Then, do the following:
./scan
../LWPCv21/output/bearings.lwf
2
A scan.log file will be generated that contains the output, and it will be located in the /LWPC/build/ directory.
This project has some hardcoded path and case-sensitivity issues that prevent it from running "out of the box" on modern, case-sensitive Linux systems like Ubuntu. I will summarize below what I have found to work, in the most basic way possible.
Use a Linux system (like Ubuntu or WSL) with gfortran and cmake installed.
sudo apt update && sudo apt install gfortran cmakeClone the repo and build the project using the README instructions.
git clone https://github.com/[user]/LWPC.gitcd LWPCcmake -B buildcmake --build buildThe program crashes because it can't find its data files. You must provide an absolute path in lwpcDAT.loc.
cd LWPCv21pwdCopy this output into the
/LWPC/LWPCv21/lwpcDAT.locfile, replacing the string currently in there.The code is hardcoded to look for lowercase directory names (lwpc, lwpcv21), but the repository uses uppercase (LWPC, LWPCv21). We can fix this by creating symbolic links (symlinks).
cd ../..-> Gets you out ofLWPC/LWPCv21so you are in your base directory.ln -s LWPC lwpccd LWPCln -s LWPCv21 lwpcv21The example .inp files point to the wrong directory (assuming you haven't changed anything). Open an example like bearings.inp in
/LWPC/LWPCv21and change the file directories from../output/to../LWPCv21/output. This must be done for any .inp files you want to run.TEST the program by running an example .inp file by doing the following:
../build./lwpc.bin ../LWPCv21/bearingsThe program should run with no errors. Then, do the following:
./scan../LWPCv21/output/bearings.lwf2A scan.log file will be generated that contains the output, and it will be located in the
/LWPC/build/directory.