CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[] POSIX/POSIX.o Error 1 when compiling OpenFoam2112 in Ubuntu20.04

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By PassengerC07

LinkBack Thread Tools Search this Thread Display Modes
Old   May 9, 2022, 22:20
Default POSIX/POSIX.o Error 1 when compiling OpenFoam2112 in Ubuntu20.04
New Member
Join Date: May 2022
Posts: 3
Rep Power: 2
wdm is on a distinguished road
I followed instruction and got the following error when compiling OpenFoam 2112 in Ubuntu 20.04

vi log.linux64GccDPInt32Opt
<template-parameter-1-2> >::assign(const _Ch_type*, std::__cxx11::basic_regex< <template-parameter-1-1>, <template-parameter-1-2> >::flag_type) [with _Ch_type = char; _Rx_traits = std::__cxx11::regex_traits<char>; std::__cxx11::basic_regex< <template-parameter-1-1>, <template-parameter-1-2> >::flag_type = std::regex_constants::syntax_option_type]’
/home/user/src/OpenFOAM-v2112/src/OpenFOAM/lnInclude/regExpCxxI.H:188:22: required from here
/usr/include/c++/9/bits/regex_scanner.tcc:101:23: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
101 | if (std::strchr(_M_spec_char, _M_ctype.narrow(__c, ' ')) == nullptr)
| ^~~~~~~~~~~~
| |
| const char*
In file included from /home/user/src/OpenFOAM-v2112/src/OpenFOAM/lnInclude/string.H:56,
from /home/user/src/OpenFOAM-v2112/src/OpenFOAM/lnInclude/word.H:46,
from /home/user/src/OpenFOAM-v2112/src/OpenFOAM/lnInclude/fileName.H:51,
from /home/user/src/OpenFOAM-v2112/src/OpenFOAM/lnInclude/fileNameList.H:49,
from /home/user/src/OpenFOAM-v2112/src/OpenFOAM/lnInclude/OSspecific.H:42,
from POSIX.C:37:
/usr/include/c++/9/cstring:106:16: note: initializing argument 1 of ‘char* std::strchr(char*, int)’
106 | strchr(char* __s, int __n)
| ~~~~~~^~~
make: *** [/home/user/src/OpenFOAM-v2112/wmake/rules/General/transform:35: /home/user/src/OpenFOAM-v2112/build/linux64GccDPInt32Opt/src/OSspecific/POSIX/POSIX.o] Error 1
"log.linux64GccDPInt32Opt" 55913L, 5616415C
I have the following software installed:
user@PC:~/src/OpenFOAM-v2112$ mpiexec --version
mpiexec (OpenRTE) 4.0.3
Report bugs to
user@ PC:~/src/OpenFOAM-v2112$ cmake --version
cmake version 3.16.3
user@ PC:~/src/OpenFOAM-v2112$ flex --version
flex 2.6.4
user@PC:~/src/OpenFOAM-v2112$ m4 --version
m4 (GNU M4) 1.4.18
user@PC:~/src/OpenFOAM-v2112$ gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Any idea what might be the root cause of that error? gcc? thanks.
wdm is offline   Reply With Quote

Old   July 15, 2022, 05:51
New Member
Join Date: Jul 2022
Posts: 6
Rep Power: 2
PassengerC07 is on a distinguished road
The original poster might have figured this one out but I'm posting it for future reference.

Basically you have messed up the LD_LIBRARY_PATH environment variable in some ways. Check your bashrc or bash_profile and see if you have exported some weird path to it. Do "echo $LD_LIBRARY_PATH".

To solve this, clean up your bashrc (comment out any exported LD_LIBRARY_PATH ) and restart the terminal for a fresh environment. Then you should be fine to go ahead with the compilation. You might also want to deactivate any conda environment as well just to be sure, even the base one.
olesen likes this.
PassengerC07 is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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