- #1
emilmammadzada
- 109
- 18
- TL;DR Summary
- Running the tests njoy16 in ubuntu terminal
With which commands can I build and run the tests files in njoy16 on ubuntu?
cd NJOY2016-2016.69
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../
make -j8
sudo make install
make test
i want build and run in tests sample 01 .I dont know using which commandlinesAlex A said:This is for njoy2016 ? A new release happened an hour ago. I grabbed it, unpacked and did,
Code:cd NJOY2016-2016.69 mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release ../ make -j8 sudo make install make test
You need some things installed, git, python, cmake, a fortran compiler. This is under ubuntu.
cd tests
cd 01
cp ../../../tests/resources/t511 tape20
cp ../../../tests/resources/t322 tape26
njoy < input
app give error command not foundAlex A said:(you are in build, having built and installed, the files tape20 and tape26 may already be there if you've run the tests)
The output messages is in the file called output. The result is in a file called tape25 which should match the reference file in the same directory. There are other files too, I have no idea what they are.Code:cd tests cd 01 cp ../../../tests/resources/t511 tape20 cp ../../../tests/resources/t322 tape26 njoy < input
i am trying to download it again if i get an error i will add it hereAlex A said:This sounds like the build did not complete correctly. What errors did you get at the end of the cmake step and the make step?
emil@DESKTOP-:~/NJOY2016/build$ cmake -DCMAKE_BUILD_TYPE=Release ../emilmammadzada said:i am trying to download it again if i get an error i will add it here
emil@DESKTOP-:~/NJOY2016/build$ makeAlex A said:Ok, any fatal errors running the make command?
emil@DESKTOP-:~/NJOY2016/build/tests/01$ lemilmammadzada said:emil@DESKTOP-:~/NJOY2016/build$ make
[ 92%] Building Fortran object CMakeFiles/njoy.dir/src/main.f90.o
[ 95%] Linking Fortran shared library libnjoy.so
[ 95%] Built target njoy
Scanning dependencies of target njoy_executable
[ 97%] Building Fortran object CMakeFiles/njoy_executable.dir/src/main.f90.o
[100%] Linking Fortran executable njoy
[100%] Built target njoy_executable
emil@DESKTOP-:~/NJOY2016/build$ sudo make install
[sudo] password for emil:
[ 95%] Built target njoy
[100%] Built target njoy_executable
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/libnjoy.so
-- Installing: /usr/local/bin/njoy
-- Set runtime path of "/usr/local/bin/njoy" to ""
emil@DESKTOP-:~/NJOY2016/build$ make test
76/77 Test #76: Test76 ........................... Passed 211.17 sec
Start 77: Test78
77/77 Test #77: Test78 ........................... Passed 0.59 sec
100% tests passed, 0 tests failed out of 77
Total Test time (real) = 2156.79 sec
cmake -D static_libraries=True -D static_njoy=True -D CMAKE_EXE_LINKER_FLAGS="-static" ../
this libnjoy.so in the build directoryAlex A said:That is strange. Does /usr/local/lib/libnjoy.so exist on your system?
A suggestion from the bug reports is to use this cmake line instead to make a static executable.
Rebuilding from that and installing again might avoid the problem.Code:cmake -D static_libraries=True -D static_njoy=True -D CMAKE_EXE_LINKER_FLAGS="-static" ../
i try again its runningemilmammadzada said:this libnjoy.so in the build directory
emil@DESKTOP-:~/NJOY2016-2016.69/build$ l
CMakeCache.txt CTestTestfile.cmake Testing/ fortran_modules/ libnjoy.so* tests/
CMakeFiles/ Makefile cmake_install.cmake install_manifest.txt njoy*
To install njoy16 on Ubuntu, you first need to clone the repository from GitHub. Use the command `git clone https://github.com/njoy/NJOY2016.git`. Then, navigate to the NJOY2016 directory using `cd NJOY2016` and compile the code using `mkdir build && cd build && cmake .. && make`. Finally, install it using `sudo make install`.
Before running njoy16 tests, ensure that you have CMake, a Fortran compiler (such as gfortran), and Python installed on your system. You can install these prerequisites using `sudo apt-get install cmake gfortran python3`.
To run the tests for njoy16, navigate to the build directory where you compiled njoy16. Then, execute the command `ctest` to run all the tests. You can also use `ctest -V` for verbose output to get more detailed information about the tests being run.
If a test fails, first check the verbose output using `ctest -V` to identify the specific error. Ensure that all dependencies are correctly installed and that you have the latest version of njoy16. You can also consult the documentation or seek help from the njoy16 community on GitHub or relevant forums.
To verify that njoy16 is correctly installed, you can run a simple test case provided in the `examples` directory of the NJOY2016 repository. Navigate to the `examples` directory and execute one of the example scripts. If the script runs without errors and produces the expected output, njoy16 is correctly installed.