Running the tests njoy16 in ubuntu terminal

In summary: Found Python3: /usr/bin/python3.10 (found suitable version "3.10.6", minimum required is "3.5") found components: Interpreter-- The Fortran compiler identification is GNU 11.3.0-- Detecting Fortran compiler ABI info-- Detecting Fortran compiler ABI info - done-- Check for working Fortran compiler: /usr/bin/f95 - skippedCMake Warning (dev) at CMakeLists.txt:104 (list): Policy CMP0121 is not set: The list() command now validates parsing of index arguments.
  • #1
emilmammadzada
118
19
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?
 
Engineering news on Phys.org
  • #2
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.
 
  • Like
Likes emilmammadzada
  • #3
Alex 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.
i want build and run in tests sample 01 .I dont know using which commandlines
emil@DESKTOP-:~/NJOY2016$ l
CMakeLists.txt LICENSE README.md ReleaseNotes.md build/ docs/ metaconfigure/ src/ tests/
emil@DESKTOP-:~/NJOY2016$ cd build
emil@DESKTOP-:~/NJOY2016/build$ l
CMakeCache.txt CTestTestfile.cmake cmake_install.cmake libnjoy.so* output
CMakeFiles/ Makefile fortran_modules/ njoy* tests/
emil@DESKTOP-:~/NJOY2016/build$ cd tests
emil@DESKTOP-:~/NJOY2016/build/tests$ l
01/ 06/ 11/ 16/ 21/ 26/ 31/ 36/ 41/ 46/ 51/ 56/ 61/ 66/ 71/ 76/ execute.py
02/ 07/ 12/ 17/ 22/ 27/ 32/ 37/ 42/ 47/ 52/ 57/ 62/ 67/ 72/ CMakeFiles/
03/ 08/ 13/ 18/ 23/ 28/ 33/ 38/ 43/ 48/ 53/ 58/ 63/ 68/ 73/ CTestTestfile.cmake
04/ 09/ 14/ 19/ 24/ 29/ 34/ 39/ 44/ 49/ 54/ 59/ 64/ 69/ 74/ Makefile
05/ 10/ 15/ 20/ 25/ 30/ 35/ 40/ 45/ 50/ 55/ 60/ 65/ 70/ 75/ cmake_install.cmake
emil@DESKTOP-:~/NJOY2016/build/tests$ cd 01
emil@DESKTOP-:~/NJOY2016/build/tests/01$ l
CMakeFiles/ Makefile input* referenceTape25 tape26*
CTestTestfile.cmake cmake_install.cmake output tape20* test.inp
emil@DESKTOP-:~/NJOY2016/build/tests/01$ ???
 
  • #4
(you are in build, having built and installed, the files tape20 and tape26 may already be there if you've run the tests)
Code:
cd tests
cd 01
cp ../../../tests/resources/t511 tape20
cp ../../../tests/resources/t322 tape26
njoy < input
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.
 
  • Like
Likes emilmammadzada
  • #5
Alex 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)
Code:
cd tests
cd 01
cp ../../../tests/resources/t511 tape20
cp ../../../tests/resources/t322 tape26
njoy < input
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.
app give error command not found
emil@DESKTOP-:~/NJOY2016/build/tests/01$ l
CMakeFiles/ CTestTestfile.cmake Makefile cmake_install.cmake input* output referenceTape25 tape20* tape26*
emil@DESKTOP-:~/NJOY2016/build/tests/01$ njoy < input
njoy: command not found
emil@DESKTOP-:~/NJOY2016/build/tests/01$
 
  • #6
You did a make and a sudo make install?
 
  • Like
Likes emilmammadzada
  • #7
i did make and a sudo make install .app give it error
emil@DESKTOP-:~/NJOY2016/build/tests/01$ l
CMakeFiles/ CTestTestfile.cmake Makefile cmake_install.cmake input* output referenceTape25 tape20* tape26*
emil@DESKTOP-:~/NJOY2016/build/tests/01$ njoy < input
njoy: error while loading shared libraries: libnjoy.so: cannot open shared object file: No such file or directory
 
  • #8
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?
 
  • Like
Likes emilmammadzada
  • #9
Alex 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?
i am trying to download it again if i get an error i will add it here
 
  • #10
emilmammadzada said:
i am trying to download it again if i get an error i will add it here
emil@DESKTOP-:~/NJOY2016/build$ cmake -DCMAKE_BUILD_TYPE=Release ../
-- Found Python3: /usr/bin/python3.10 (found suitable version "3.10.6", minimum required is "3.5") found components: Interpreter
-- The Fortran compiler identification is GNU 11.3.0
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/f95 - skipped
CMake Warning (dev) at CMakeLists.txt:104 (list):
Policy CMP0121 is not set: The list() command now validates parsing of
index arguments. Run "cmake --help-policy CMP0121" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
Invalid list index "CMAKE_INSTALL_RPATH".
This warning is for project developers. Use -Wno-dev to suppress it.

-- Found Git: /usr/bin/git (found version "2.34.1")
--
-- -----------------------------------------------------------
--
-- njoy
-- Git current branch: master
-- Git commit hash: a3a2d7fa2f9f3aa3a543467084e080fa4bc5b587
--
-- -----------------------------------------------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /home/emil/NJOY2016/build
 
  • Like
Likes Alex A
  • #11
Ok, any fatal errors running the make command?
 
  • Informative
Likes emilmammadzada
  • #12
Alex A said:
Ok, any fatal errors running the make command?
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
 
  • #13
emilmammadzada 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
emil@DESKTOP-:~/NJOY2016/build/tests/01$ l
CMakeFiles/ CTestTestfile.cmake Makefile cmake_install.cmake input* referenceTape25 tape20* tape26*
emil@DESKTOP-:~/NJOY2016/build/tests/01$ njoy < input
njoy: error while loading shared libraries: libnjoy.so: cannot open shared object file: No such file or directory
emil@DESKTOP-:~/NJOY2016/build/tests/01$
same error
 
  • Like
Likes Alex A
  • #14
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.
Code:
cmake -D static_libraries=True -D static_njoy=True -D CMAKE_EXE_LINKER_FLAGS="-static" ../
Rebuilding from that and installing again might avoid the problem.
 
  • Informative
Likes emilmammadzada
  • #15
Alex 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.
Code:
cmake -D static_libraries=True -D static_njoy=True -D CMAKE_EXE_LINKER_FLAGS="-static" ../
Rebuilding from that and installing again might avoid the problem.
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*
 
  • #16
emilmammadzada 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*
i try again its running
emil@DESKTOP-:~/NJOY2016-2016.69/build/tests/01$ njoy < input

njoy 2016.69 07Feb22 02/08/23 03:44:56
*****************************************************************************

moder... 0.0s

reconr... 0.1s

broadr... 0.1s

heatr... 0.1s

thermr... 0.1s

wrote thermal data for temp = 2.9600E+02 0.2s

thermr... 0.2s

***warning***maximum value of beta limits the allowed energy transfer
the sct approx. will be used for transfers larger than 1.024 ev.

wrote thermal data for temp = 2.9600E+02 0.7s

groupr... 0.7s

---message from conver---cannot do complete particle production for mt= 91
only mf4/mf5 provided

moder... 1.1s
1.8s
*****************************************************************************
emil@DESKTOP-:~/NJOY2016-2016.69/build/tests/01$ l
CMakeFiles/ Makefile input* referenceTape25 tape21 tape23 tape25
CTestTestfile.cmake cmake_install.cmake output tape20* tape22 tape24 tape26*
emil@DESKTOP-:~/NJOY2016-2016.69/build/tests/01$ gedit output
 
  • Like
Likes Alex A

FAQ: Running the tests njoy16 in ubuntu terminal

How do I install njoy16 on Ubuntu?

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`.

What are the prerequisites for running njoy16 tests on Ubuntu?

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`.

How do I run the tests for njoy16 in the Ubuntu terminal?

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.

What should I do if a test fails when running njoy16 tests?

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.

How can I verify that njoy16 is correctly installed on my system?

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.

Back
Top