CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[OpenFOAM.com] The error during installation of calculix

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Hiroaki Sumikawa

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 24, 2019, 04:18
Default The error during installation of calculix
  #1
New Member
 
Hiroaki Sumikawa
Join Date: Jul 2018
Posts: 9
Rep Power: 7
Hiroaki Sumikawa is on a distinguished road
Hi, everyone.

I want to do FSI using OpenFOAM, CalculiX and preCICE.
So, I tried to install them. But I encounterd the error when building cgx for CalculiX.

My development environment is Ubuntu18.04LTS, OpenFOAM-v1806 and I refferd this site(https://github.com/luvres/calculix) to build the cgx.


this is the error

Code:
/usr/include/c++/7/bits/stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
                                                        ^
/usr/include/c++/7/bits/stl_algobase.h:265:56: error: macro "max" passed 3 arguments, but takes just 2
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
                                                        ^
In file included from ../../libSNL/src/snlCurveBase.h:23:0,
                 from ../../libSNL/src/snlCurve.h:25,
                 from ../../libSNL/src/snlSurface.h:20,
                 from uselibSNL.cpp:35:
../../libSNL/src/snlKnotVector.h:115:18: error: macro "max" requires 2 arguments, but only 1 given
         knot max() const;  // Max knot val.
                  ^
../../libSNL/src/snlKnotVector.h:116:18: error: macro "min" requires 2 arguments, but only 1 given
         knot min() const;  // Min knot val.
                  ^
In file included from ./cgx.h:25:0,
                 from uselibSNL.h:8,
                 from uselibSNL.cpp:31:
/usr/include/c++/7/bits/stl_algobase.h:195:5: error: expected unqualified-id before ‘const’
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/7/bits/stl_algobase.h:195:5: error: expected ‘)’ before ‘const’
/usr/include/c++/7/bits/stl_algobase.h:195:5: error: expected ‘)’ before ‘const’
/usr/include/c++/7/bits/stl_algobase.h:195:5: error: expected initializer before ‘const’
/usr/include/c++/7/bits/stl_algobase.h:219:5: error: expected unqualified-id before ‘const’
     max(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/7/bits/stl_algobase.h:219:5: error: expected ‘)’ before ‘const’
/usr/include/c++/7/bits/stl_algobase.h:219:5: error: expected ‘)’ before ‘const’
/usr/include/c++/7/bits/stl_algobase.h:219:5: error: expected initializer before ‘const’
In file included from /usr/include/c++/7/bits/char_traits.h:39:0,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from uselibSNL.cpp:33:
/usr/include/c++/7/bits/stl_algobase.h:246:7: error: expected primary-expression before ‘if’
       if (__comp(__b, __a))
       ^~
/usr/include/c++/7/bits/stl_algobase.h:246:7: error: expected ‘}’ before ‘if’
/usr/include/c++/7/bits/stl_algobase.h:246:7: error: expected ‘;’ before ‘if’
/usr/include/c++/7/bits/stl_algobase.h:248:7: error: expected unqualified-id before ‘return’
       return __a;
       ^~~~~~
/usr/include/c++/7/bits/stl_algobase.h:268:7: error: expected primary-expression before ‘if’
       if (__comp(__a, __b))
       ^~
/usr/include/c++/7/bits/stl_algobase.h:268:7: error: expected ‘}’ before ‘if’
/usr/include/c++/7/bits/stl_algobase.h:268:7: error: expected ‘;’ before ‘if’
/usr/include/c++/7/bits/stl_algobase.h:270:7: error: expected unqualified-id before ‘return’
       return __a;
       ^~~~~~
/usr/include/c++/7/bits/stl_algobase.h:271:5: error: expected declaration before ‘}’ token
     }

I want to some advice or hints.
I'm glad I recieved some reply.

Thank you.

Last edited by wyldckat; April 25, 2019 at 07:26. Reason: Added [CODE][/CODE] markers
Hiroaki Sumikawa is offline   Reply With Quote

Old   April 25, 2019, 15:29
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Hiroaki Sumikawa,

I had some time today and I was curious about this... as far as I can figure out, the authors that released CalculiX 2.14 were using Ubuntu 16.04 and not 18.04.

So here is how I managed to build it on Ubuntu 18.04, but using GCC 5:
  1. Install the necessary packages, by running this command:
    Code:
    sudo apt install gfortran-5 gcc-5 g++-5
  2. Need to make a few changes to the code, by running:
    Code:
    cd CalculiX
    sed -i -e 's=^CC=#CC=' -e 's=^FC=#FC=' ./ccx_2.14/src/Makefile
    sed -i -e 's=g++=$(CXX)=' ./cgx_2.14.1/src/Makefile ./libSNL/src/makefile
    cd ..
  3. Then to build:
    Code:
    export CC=gcc-5
    export CXX=g++-5
    export F77=gfortran-5
    export FC=gfortran-5
    ./install > log.make 2>&1
  4. The last command will redirect the output to the file "log.make", so that it's easier to pinpoint any build issues.
I'm running this a second time, to double-check if it's working and will update this post if there are any additional changes needed.

edit: Yep, it's confirmed that it works. However, I did initially follow the instructions given on the README file, so I built the latest version that was on Git ready to be built, which is likely 2.14.

Best regards,
Bruno
__________________

Last edited by wyldckat; April 25, 2019 at 15:37. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Old   April 25, 2019, 20:43
Default
  #3
New Member
 
Hiroaki Sumikawa
Join Date: Jul 2018
Posts: 9
Rep Power: 7
Hiroaki Sumikawa is on a distinguished road
Hello, wyldchat.


Thank you for you reply and kind instruction,

I was able to build CalculiX and did tutorials! :-)


I'm really thankful to you!


Hiroaki
wyldckat and MakisH like this.
Hiroaki Sumikawa is offline   Reply With Quote

Old   April 9, 2020, 12:01
Default Error during installation of CalculiX (In function `second_':)
  #4
New Member
 
Prasad ADHAV
Join Date: Apr 2020
Location: Belval, Luxembourg
Posts: 10
Rep Power: 6
Alpha001 is on a distinguished road
Hello,

I am Prasad ADHAV.
I want to perform coupled simulation using multiple solvers (OpenFOAM, CalculiX, XDEM).

I have been following the instructions to install CalculiX and its dependencies as best as I could.
I have already installed all the dependencies.

In the installation when I say
Code:
make
I get the following error.

Code:
gfortran -fopenmp -Wall -O3 -o bin/ccx_preCICE bin/ccx_2.15.o bin/ccx_2.15.a /home/prasad/SPOOLES.2.2//spooles.a -L/usr/local/lib -lprecice -lstdc++ -L/home/prasad/yaml-cpp-yaml-cpp-0.6.2//build -lyaml-cpp  /home/prasad/ARPACK//libarpack_INTEL.a -lpthread -lm -lc
/home/prasad/ARPACK//libarpack_INTEL.a(second.o): In function `second_':
second.f:(.text+0x14): undefined reference to `etime_'
collect2: error: ld returned 1 exit status
Makefile:101: recipe for target 'bin/ccx_preCICE' failed
make: *** [bin/ccx_preCICE] Error 1


I tried changing the line 24 in ARPACK/UTIL/second.f to
Code:
 *      EXTERNAL           ETIME
but I am still getting the same error.

Can anyone tell me how to fix it?

Thank you in advance for the help.
Alpha001 is offline   Reply With Quote

Reply

Tags
build error, calulix, cgx


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i fix installation error of ansys 19.0 on ubuntu 18.04 rid_taki ANSYS 15 June 7, 2021 06:32
[foam-extend.org] A smooth installation of foam-3.0-extend on OpenSUSE 13.1 64-bits cookcaptain OpenFOAM Installation 7 May 26, 2015 11:22
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 18:56
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07
Installation problems shellbell1999 OpenFOAM Installation 9 April 6, 2006 13:29


All times are GMT -4. The time now is 18:56.