1 (edited by ABains 30-11-2018 14:26:24)

Topic: Installing OOFEG

Hello!

I am having some issues trying to install OOFEG.

I have installed build-essential, xorg-dev and libx11-dev.  The version of Ckit and Elixir that I have downloaded is from the OOFEM website. The compiler that I am using is: gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)



When configuring Ckit and Elixir, I get:

amrit@amrit-Latitude-7490:~/Ckit/src$ ./configure
creating cache ./config.cache
checking whether make sets $MAKE... yes
checking for gcc... gcc
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for POSIXized ISC... no
checking whether ln -s works... yes
checking how to run the C preprocessor... gcc -E
checking for AIX... no
checking for ranlib... ranlib
checking for gcc... yes
checking compile with prototypes... yes (gcc)
checking for unistd.h... yes
checking whether cross-compiling... no
checking for ANSI C header files... yes
checking for working const... yes
checking for random... yes
checking for rand... yes
updating cache ./config.cache
creating ./config.status
creating Makefile



amrit@amrit-Latitude-7490:~/Elixir/src$ ./configure
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for library containing strerror... none required
checking whether ln -s works... yes
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for AIX... no
checking for ranlib... ranlib
checking build system type... x86_64-pc-linux-gnuoldld
checking host system type... x86_64-pc-linux-gnuoldld
checking for gcc... yes
checking compile with prototypes... yes (gcc )
checking for gm4... no
checking for gnum4... no
checking for m4... /usr/bin/m4
checking for _get_list_next in -lckit... no
checking guess of libckit.a location... ../../Ckit/src
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking ckitcfg.h usability... no
checking ckitcfg.h presence... no
checking for ckitcfg.h... no
checking guess of Ckit includes location... ../../Ckit/include
checking Elixir.h usability... no
checking Elixir.h presence... no
checking for Elixir.h... no
checking guess of Elixir includes location... ../include
checking for an ANSI C-conforming const... yes
checking for getcwd... yes
checking for getwd... yes
checking for memcpy... yes
checking for qsort... yes
checking for random... yes
checking for rand... yes
checking for setpwent... yes
checking for strchr... yes
checking for strerror... yes
checking for mkstemp... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for ANSI C header files... (cached) yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for X... libraries , headers
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking for XawDialogGetValueString in -lXaw... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating ../include/Ecfg.h
config.status: ../include/Ecfg.h is unchanged






Making Ckit gives warnings like these:

amrit@amrit-Latitude-7490:~/Ckit/src$ make all
gcc -c -I../include   -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_RANDOM=1 -DHAVE_RAND=1   -g -O  alistP.c
gcc -c -I../include   -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_RANDOM=1 -DHAVE_RAND=1   -g -O  hashP.c
gcc -c -I../include   -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_RANDOM=1 -DHAVE_RAND=1   -g -O  listP.c
listP.c: In function ‘swap_lists’:
listP.c:510:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
             tptr = (LIST) p1;  \
                    ^
listP.c:521:3: note: in expansion of macro ‘swap_ptrs’
   swap_ptrs(LISTlength(list), LISTlength(temp), int);
   ^~~~~~~~~
listP.c:512:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      p2   = (type) tptr;  \




Similarly, when making Elixir, the warnings are like this:


ctlblock.c:127:5: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
     fscanf(file_p, "%d", &int_val);

The .a files do get created in the src folders so I assume that Ckit and Elixir installed fine.





Building OOFEM with OOFEG, I get these errors:

amrit@amrit-Latitude-7490:~/build/oofem-2.5$ ccmake /home/amrit/oofem-2.5
amrit@amrit-Latitude-7490:~/build/oofem-2.5$ make
Scanning dependencies of target fm
[  0%] Building CXX object src/fm/CMakeFiles/fm.dir/fluidmodel.C.o
[  1%] Building CXX object src/fm/CMakeFiles/fm.dir/cbs.C.o
[  1%] Building CXX object src/fm/CMakeFiles/fm.dir/supg.C.o
[  1%] Building CXX object src/fm/CMakeFiles/fm.dir/stokesflow.C.o
[  1%] Building CXX object src/fm/CMakeFiles/fm.dir/stokesflowvelocityhomogenization.C.o
[  1%] Building CXX object src/fm/CMakeFiles/fm.dir/fmelement.C.o
[  2%] Building CXX object src/fm/CMakeFiles/fm.dir/supgelement.C.o
In file included from /home/amrit/oofem-2.5/src/fm/supgelement.C:50:0:
/home/amrit/oofem-2.5/src/oofemlib/oofeggraphiccontext.h:52:16: error: ‘__class’ has not been declared
  #define class __class
                ^
In file included from /usr/include/c++/7/cmath:45:0,
                 from /usr/include/c++/7/math.h:36,
                 from /home/amrit/Elixir/include/Etypes.h:47,
                 from /home/amrit/Elixir/include/Esimple.h:70,
                 from /home/amrit/oofem-2.5/src/oofemlib/oofeggraphiccontext.h:62,
                 from /home/amrit/oofem-2.5/src/fm/supgelement.C:50:
/usr/include/math.h:755:9: error: ‘__T’ was not declared in this scope
iszero (__T __val)
         ^~~
/usr/include/math.h:755:9: note: suggested alternative: ‘__N’
iszero (__T __val)
         ^~~
         __N
/usr/include/math.h:756:1: error: expected ‘;’ before ‘{’ token
{
^
src/fm/CMakeFiles/fm.dir/build.make:206: recipe for target 'src/fm/CMakeFiles/fm.dir/supgelement.C.o' failed
make[2]: *** [src/fm/CMakeFiles/fm.dir/supgelement.C.o] Error 1
CMakeFiles/Makefile2:1516: recipe for target 'src/fm/CMakeFiles/fm.dir/all' failed
make[1]: *** [src/fm/CMakeFiles/fm.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2





If I try to do the above steps again but using gcc version 4.8.5 (Ubuntu 4.8.5-4ubuntu8), I get the following error:

[  6%] Building CXX object src/fm/CMakeFiles/fm.dir/levelsetpcs.C.o
In file included from /home/amrit/oofem-2.5/src/oofemlib/geotoolbox.h:45:0,
                 from /home/amrit/oofem-2.5/src/fm/levelsetpcs.h:39,
                 from /home/amrit/oofem-2.5/src/fm/levelsetpcs.C:35:
/home/amrit/oofem-2.5/src/oofemlib/oofeggraphiccontext.h:52:16: error: ‘__class’ has not been declared
  #define class __class
                ^
In file included from /home/amrit/Elixir/include/Etypes.h:47:0,
                 from /home/amrit/Elixir/include/Esimple.h:70,
                 from /home/amrit/oofem-2.5/src/oofemlib/oofeggraphiccontext.h:62,
                 from /home/amrit/oofem-2.5/src/oofemlib/geotoolbox.h:45,
                 from /home/amrit/oofem-2.5/src/fm/levelsetpcs.h:39,
                 from /home/amrit/oofem-2.5/src/fm/levelsetpcs.C:35:
/usr/include/math.h:755:9: error: ‘iszero’ declared as an ‘inline’ variable
iszero (__T __val)
         ^
/usr/include/math.h:755:9: error: template declaration of ‘bool iszero’
/usr/include/math.h:755:13: error: expected ‘)’ before ‘__val’
iszero (__T __val)
             ^
src/fm/CMakeFiles/fm.dir/build.make:854: recipe for target 'src/fm/CMakeFiles/fm.dir/levelsetpcs.C.o' failed
make[2]: *** [src/fm/CMakeFiles/fm.dir/levelsetpcs.C.o] Error 1
CMakeFiles/Makefile2:1516: recipe for target 'src/fm/CMakeFiles/fm.dir/all' failed
make[1]: *** [src/fm/CMakeFiles/fm.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2



Thank you in advance!

Re: Installing OOFEG

I have solved the issue. I changed to Ubuntu 16.04 and compiled using gcc-5.4.0