Serpent on Windows via Cygwin

Compiler issues (Intel compiler, mpicc, etc.), data libraries and everything needed to get Serpent running is discussed here
Andrei Fokau
Posts: 77
Joined: Thu Mar 25, 2010 12:25 am
Security question 2: 0
Location: KTH, Stockholm, Sweden
Contact:

Serpent on Windows via Cygwin

Post by Andrei Fokau » Tue Jul 13, 2010 4:10 pm

We have a number of students who do not have experience with Linux, so we tried to compile Serpent in Cygwin environment. Unfortunately, Cygwin does not provide fully compatible libraries, among which is complex.h referred from tgmath.h. It results in the following error message

Code: Select all

$ make
gcc -Wall -ansi -pedantic -DNO_GFX_MODE -ffast-math -O3 -c aburnoutput.c
... (some lines are skipped)
gcc -Wall -ansi -pedantic -DNO_GFX_MODE -ffast-math -O3 -c atof.c
atof.c: In function `AtoF':
atof.c:14: warning: array subscript has type `char'
gcc -Wall -ansi -pedantic -DNO_GFX_MODE -ffast-math -O3 -c atoi.c
atoi.c: In function `AtoI':
atoi.c:14: warning: array subscript has type `char'
gcc -Wall -ansi -pedantic -DNO_GFX_MODE -ffast-math -O3 -c azirot.c
gcc -Wall -ansi -pedantic -DNO_GFX_MODE -ffast-math -O3 -c binarysearch.c
gcc -Wall -ansi -pedantic -DNO_GFX_MODE -ffast-math -O3 -c broadcrosssection.c
In file included from broadcrosssection.c:4:
/usr/lib/gcc/i686-pc-cygwin/4.3.4/include/tgmath.h:38:21: error: complex.h: No s
uch file or directory
There are many threads in the cygwin mailing lists about this issue.

As an attempt to find a workaround, we have replaced "#include <tgmath.h>" with "#include <math.h>". It allows to compile the code, but calculations stop with the following error:

Code: Select all

Calculating material total cross sections:
material fuel...
material ZrN...
material boron...
material steel...
material Lead...
OK.

$

Sampling initial source...
SampleSrc: Unable to sample initial fission source.
It seems that Serpent relies on tgmath, so we need to find another way. What would you recommend?
KTH Reactor Physics (Stockholm, Sweden) neutron.kth.se

User avatar
Jaakko Leppänen
Site Admin
Posts: 2388
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: Serpent on Windows via Cygwin

Post by Jaakko Leppänen » Tue Jul 13, 2010 8:10 pm

The error message "Unable to sample initial source" probably means that there is no fissile material in the geometry. If your input is OK, then the reason is probably in that the subroutines do not work properly without the correct math libraries. You can try to modify the source code and leave broadcrosssection.c out altogether, but the only good solution I can think of is to find and install the correct libraries.

If removing broadcrosssection.c fixes the problem, I can add it as a compiler option for the next update.

Andrei Fokau
Posts: 77
Joined: Thu Mar 25, 2010 12:25 am
Security question 2: 0
Location: KTH, Stockholm, Sweden
Contact:

Re: Serpent on Windows via Cygwin

Post by Andrei Fokau » Thu Jul 15, 2010 2:54 pm

Jaakko, the students gave up and have installed Linux to work with Serpent. So we will wait for some more Windows users to test your suggestion!
KTH Reactor Physics (Stockholm, Sweden) neutron.kth.se

User avatar
Jaakko Leppänen
Site Admin
Posts: 2388
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: Serpent on Windows via Cygwin

Post by Jaakko Leppänen » Thu Jul 22, 2010 3:11 pm

Andrei Fokau wrote:Jaakko, the students gave up and have installed Linux to work with Serpent.
Good for them ;)

Let me know if you decide to try the windows installation again.
- Jaakko

User avatar
Jaakko Leppänen
Site Admin
Posts: 2388
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: Serpent on Windows via Cygwin

Post by Jaakko Leppänen » Tue Nov 16, 2010 11:25 pm

Has anyone had any success installing Serpent in Windows yet?
- Jaakko

Vivi
Posts: 8
Joined: Tue Jan 25, 2011 2:29 am

Re: Serpent on Windows via Cygwin

Post by Vivi » Wed Jan 26, 2011 11:43 pm

Jaakko,

I tried unsuccessfully to run Serpent under Cygwin, out of curiosity.

For that, I did this :
- Removed compilation and linking of broadcrosssection.c in makefile.
- Removed call to broadcrossection in dopplerbroad.c.
- Followed recommendation of readme for removing GD library calls (I could have tried harder on that, but not the main concern here).

Then I didn't anymore encountered the tgmath.h error while compiling.

While running, I can find along the first lines, although I suspect it doesn't have any consequences :

Code: Select all

Warning : Unable to read available memory from /proc/meminfo
Then, it continues and reach the same point described above :

Code: Select all

SampleSrc : Unable to sample initial fission source
And then the code stops.

Nevertheless, it won't prevent me from using Serpent under Linux.

Various informations :
Serpent 1.1.7 (I didn't update for this test, as I suspected you wouldn't have changed much about that between 1.1.7 and 1.1.14)
Cygwin Version : 1.7.7
Windows XP
gcc 4.3.4

Vivian

User avatar
Jaakko Leppänen
Site Admin
Posts: 2388
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: Serpent on Windows via Cygwin

Post by Jaakko Leppänen » Thu Jan 27, 2011 10:45 am

Vivian,

The error message means that the code cannot find fissile material in the geometry while sampling the initial source. This is normal if the geometry dimensions are large compared to the total volume of fissile regions, but it can also be an indication of an error in the geometry or the geometry routine. Did you try running the same input in a Linux system?

One thing you could also try is to activate the -DDEBUG -flag in the Makefile and recompile (make clean and make). This turns on some additional checks that may reveal more about the problem. (just remember to remove the option once you get the problem solved because it also slows down the calculation).

You could also try and see if Serpent can calculate the volumes by running the input with the "-checkvolumes <N>" command line option (this samples <N> random points in the geometry and calculates Monte Carlo estimates for volumes and masses).

The warning message doesn't matter

The GD libraries and graphics routines can be removed by commenting out line:

#LDFLAGS += -lgd

in the Makefile and setting option:

CFLAGS += -DNO_GFX_MODE

You don't need to make any changes in the source code for that
- Jaakko

Vivi
Posts: 8
Joined: Tue Jan 25, 2011 2:29 am

Re: Serpent on Windows via Cygwin

Post by Vivi » Mon Feb 14, 2011 3:25 am

Jaakko,

I retried to use Serpent on Cygwin. This time, I used the version 1.1.14 of Serpent. I started from the same point (Removed compilation and linking of broadcrosssection.c in makefile, Removed call to broadcrossection in dopplerbroad.c, Used "CFLAGS += -DNO_GFX_MODE").

I did try the input on a Linux system, it worked wonderfully, and I have no doubt that it is not the source of the problem : I used the default PWRMOX test.

I tried to calculate the volumes by running the input with "sss -checkvolumes 10 pwrmox", and it appears that it fails. You will find attached the log concerning this test under the name "checkvolumes10pwrmox.log".

I also noticed that warnings appears during compilation time. You will find attached "no-error.log" and "errors.log" generated with a "make -f Makefile >1 no-error.log >2 errors.log" command (no DDEBUG flag in the Makefile).
Activating DDEBUG flag (by uncommenting "CFLAGS += -DDEBUG" in the makefile) didn't appear to change lots of things, but you will also find logs generated for debug compilation as "DDEBUG-flag-no-error.log" and "DDEBUG-flag-errors.log".

I hope these logs will help to find a solution.

Vivian
Attachments
TestCygwin.zip
(7.62 KiB) Downloaded 405 times

Vivi
Posts: 8
Joined: Tue Jan 25, 2011 2:29 am

Re: Serpent on Windows via Cygwin

Post by Vivi » Mon Feb 14, 2011 4:57 am

I nearly forgot to add that :
I also tried to compile with -O0 instead of -O3 (as I used to encounter problems with another code, that I could only compile on -O1), but I didn't meet more success.

Vivian

User avatar
Jaakko Leppänen
Site Admin
Posts: 2388
Joined: Thu Mar 18, 2010 10:43 pm
Security question 2: 0
Location: Espoo, Finland
Contact:

Re: Serpent on Windows via Cygwin

Post by Jaakko Leppänen » Mon Feb 14, 2011 12:58 pm

Vivian,

There seems to be a lot of warning messages on implicit function declarations. I cannot really tell what's going on because the compilation produces an executable despite the problems. Also, the input file is apparently read, even though the routines use functions that result to the warning messages. So the warnings may not be even related to the real problem.

I need to look into this issue more thoroughly at some point. Do you need a working Windows version at this instant, or can you run your calculations on a Linux machine instead?
- Jaakko

Post Reply