facing an error during installing mumps on cygwin? - gcc

trying to install mumps on my windows laptop, followed instructions to setup cygwin first and install mumps through it....now facing this error updon running ./BuildMumpsWithNativeClientServer.script in cygwin terminal
config.status: creating include/mumpsc/config.h
Now run "make" followed by "make install"
gcc -w -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -DMUMPS_SYM -Iinclude/ -finline-functions -w -DMUMPS_SYM -Iinclude/ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -lgmp -c -o mumps.o mumps.c
gcc -w -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -DMUMPS_SYM -Iinclude/ -finline-functions -w -DMUMPS_SYM -Iinclude/ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -lgmp -c -o parse.o parse.c
gcc -w -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -DMUMPS_SYM -Iinclude/ -finline-functions -w -DMUMPS_SYM -Iinclude/ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -lgmp -c -o sys1.o sys1.c
g++ -w -DMUMPS_SYM -Iinclude/ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -O3 -lgmp -c -o arith.o arith.cpp
sys1.c:804:1: error: conflicting types for ‘itoa’
itoa (val, str, rad)
^~~~
In file included from sys1.c:51:0:
/usr/include/stdlib.h:224:8: note: previous declaration of ‘itoa’ was here
char * itoa (int, char *, int);
^~~~
make: *** [<builtin>: sys1.o] Error 1
make: *** Waiting for unfinished jobs....
arith.cpp: In function ‘void mps_exp10(char*, char*)’:
arith.cpp:855:15: error: ‘exp10’ was not declared in this scope
double aa=exp10(strtod(a,NULL));
^~~~~
arith.cpp:855:15: note: suggested alternative: ‘expx’
double aa=exp10(strtod(a,NULL));
^~~~~
expx
make: *** [<builtin>: arith.o] Error 1

I'm going to give a non-answer that (I hope) will help you achieve your ultimate goal of installing a MUMPS build on your Windows laptop. Because you're running "BuildMumpsWithNativeClientServer.script", I'm guessing you're trying to install Kevin O'Kane's version of MUMPS. You might want to switch to a production-ready MUMPS build like Intersystems Cache, GT.M, or YottaDB.
If you use Intersystems Cache, it will install natively on Windows. If you use GT.M or it's fork, YottaDB, they install cleanly on most Linux distros, but not as native Windows apps. The painless option is to install Windows Subsystem for Linux (WSL) and a linux distro on your laptop. I recommend Ubuntu 18.04 as a Linux distro, since it's the most recent long-term support linux distro that's available in the Windows store.
Once you have linux installed via WSL on your Windows box, installing GT.M only takes a single command: sudo apt install fis-gtm
I know this isn't exactly answering the question you asked, but I'm hoping it gets you the result you really want. Good luck!

Related

Install xgboost on Mac - ld: library not found

I am trying to install OpenMP enabled xgboost on my mac. I installed gcc with no problem:
brew install gcc --without-multilib
then cloned git repository:
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost; cp make/config.mk ./config.mk
but I get an error when I do
make -j4
Here is the error I get. I'd appreciate if you can help fixing this problem:
c++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -o xgboost build/cli_main.o build/learner.o build/logging.o build/c_api/c_api.o build/c_api/c_api_error.o build/common/common.o build/data/data.o build/data/simple_csr_source.o build/data/simple_dmatrix.o build/data/sparse_page_dmatrix.o build/data/sparse_page_raw_format.o build/data/sparse_page_source.o build/data/sparse_page_writer.o build/gbm/gblinear.o build/gbm/gbm.o build/gbm/gbtree.o build/metric/elementwise_metric.o build/metric/metric.o build/metric/multiclass_metric.o build/metric/rank_metric.o build/objective/multiclass_obj.o build/objective/objective.o build/objective/rank_obj.o build/objective/regression_obj.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_histmaker.o build/tree/updater_prune.o build/tree/updater_refresh.o build/tree/updater_skmaker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit.a -pthread -lm -fopenmp
c++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -shared -o lib/libxgboost.so build/learner.o build/logging.o build/c_api/c_api.o build/c_api/c_api_error.o build/common/common.o build/data/data.o build/data/simple_csr_source.o build/data/simple_dmatrix.o build/data/sparse_page_dmatrix.o build/data/sparse_page_raw_format.o build/data/sparse_page_source.o build/data/sparse_page_writer.o build/gbm/gblinear.o build/gbm/gbm.o build/gbm/gbtree.o build/metric/elementwise_metric.o build/metric/metric.o build/metric/multiclass_metric.o build/metric/rank_metric.o build/objective/multiclass_obj.o build/objective/objective.o build/objective/rank_obj.o build/objective/regression_obj.o build/tree/tree_model.o build/tree/tree_updater.o build/tree/updater_colmaker.o build/tree/updater_histmaker.o build/tree/updater_prune.o build/tree/updater_refresh.o build/tree/updater_skmaker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit.a -pthread -lm -fopenmp
clangclang: : warningwarning: : argument unused during compilation: '-pthread'argument unused during compilation: '-pthread'
ld: library not found for -lgomp
ld: library not found for -lgomp
clang: error: clanglinker command failed with exit code 1 (use -v to see invocation):
error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lib/libxgboost.so] Error 1
make: *** Waiting for unfinished jobs....
make: *** [xgboost] Error 1
I have the same issue and solved it by:
brew install clang-omp
export CC=clang-omp
export CXX=clang-omp++
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost; cp make/config.mk ./config.mk; make -j4
cd python-package
sudo python setup.py install
If you used pip to install xgboost before, then delete the previous installed xgboost from your project. Then use
pip install xgboost
to install it again.
A new versions of OSX has a Clang as a default c\c++ compiler. Therefore your c++ command refers to clang++.
You should define a CC\CXX environmental variables for your make command like this CC=gcc CXX=g++ make -j
Also you can build an OpenMP for clang OpenMPrt and customise your shell environment (I didn't try this by own)
(I have no mac at this moment to check this solution; just linux)

How to install Perl Module DBD:Oracle: Oracle 10g (32 bit) and Perl 5.18 (64 bit)

I have problem when try to install Perl module DBD:Oracle with below env
Fedora 20 64 bit
Perl 5.18 64 bit
Oracle 10g 32 bit
When try to make, it inform below error
Running Mkbootstrap for DBD::Oracle ()
chmod 644 Oracle.bs
rm -f blib/arch/auto/DBD/Oracle/Oracle.so
gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Wl,-z,relro Oracle.o dbdimp.o oci8.o -o blib/arch/auto/DBD/Oracle/Oracle.so \
-L/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib/ -lclntsh -lpthread -lperl \
/bin/ld: skipping incompatible /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib//libclntsh.so when searching for -lclntsh
/bin/ld: cannot find -lclntsh
collect2: error: ld returned 1 exit status
make: *** [blib/arch/auto/DBD/Oracle/Oracle.so] Error 1
PYTHIAN/DBD-Oracle-1.74.tar.gz
/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
PYTHIAN/DBD-Oracle-1.74.tar.gz : make NO
It seems that Perl try to search for Oralce 64bit lib but can not and error occur.
Can any one help me on this if I need to config anything before build the package?
Thanks,
Quang

Errors Installing the gem wdm in cygwin

I keep getting this error while installing the gem wdm from inside cygwin. Does anybody had the same issue and know now to fix it. Thanks. (I am Trying to install Guard gem)
$ gem install wdm
Building native extensions. This could take a while...
ERROR: Error installing wdm:
ERROR: Failed to build gem native extension.
/usr/bin/ruby.exe extconf.rb
checking for main() in -lkernel32... yes
checking for windows.h... yes
checking for ruby.h... yes
checking for HAVE_RUBY_ENCODING_H... yes
creating Makefile
make
gcc -I. -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_WINDOWS_H -DHAVE_RUBY_H -DHAVE_CONST_HAVE_RUBY_ENCODING_H -ggdb -O2 -pipe -fno-strict-aliasing -o entry.o -c entry.c
gcc -I. -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_WINDOWS_H -DHAVE_RUBY_H -DHAVE_CONST_HAVE_RUBY_ENCODING_H -ggdb -O2 -pipe -fno-strict-aliasing -o memory.o -c memory.c
gcc -I. -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_WINDOWS_H -DHAVE_RUBY_H -DHAVE_CONST_HAVE_RUBY_ENCODING_H -ggdb -O2 -pipe -fno-strict-aliasing -o monitor.o -c monitor.c
gcc -I. -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_WINDOWS_H -DHAVE_RUBY_H -DHAVE_CONST_HAVE_RUBY_ENCODING_H -ggdb -O2 -pipe -fno-strict-aliasing -o queue.o -c queue.c
gcc -I. -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_WINDOWS_H -DHAVE_RUBY_H -DHAVE_CONST_HAVE_RUBY_ENCODING_H -ggdb -O2 -pipe -fno-strict-aliasing -o rb_change.o -c rb_change.c
rb_change.c: In function ‘extract_absolute_path_from_notification’:
rb_change.c:47:16: error: ‘_MAX_FNAME’ undeclared (first use in this function)
rb_change.c:47:16: note: each undeclared identifier is reported only once for each function it appears in
rb_change.c:47:33: error: ‘_MAX_EXT’ undeclared (first use in this function)
Makefile:206: recipe for target `rb_change.o' failed
make: *** [rb_change.o] Error 1
Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/wdm-0.1.0 for inspection.
Results logged to /usr/lib/ruby/gems/1.9.1/gems/wdm-0.1.0/ext/wdm/gem_make.out
A colleague of mine had an issue with wdm the other day.
We fixed it by downloading the Ruby DevKit (Not sure if you already had this installed).
I found some pretty decent step by steps online, I'll paste them here - hope they help
Development kit is here: http://rubyinstaller.org/downloads/
Download the Development Kit and install it in say c:\devkit.
Open a command window and type c:.
Change folders by typing cd devkit.
Type ruby dk.rb init to generate the config.yml file to be used later.
Your installed Rubies will be listed there (only those installed by a RubyInstaller package are detected at present). This needs to be done only once.
Finally type, ruby dk.rb install for DevKit enhance your installed Rubies. This needs to be done only once.
Confirm your Ruby environment is correctly using the DevKit by running:
gem install wdm --platform=ruby
It’s crucial that you include the --platform=ruby option to force RubyGems to build the native gem rather than potentially installing an incorrect binary gem.

gcc cannot find bits/predefs.h on i686

Okay, so, I switched from ubuntu 12.04 64-bit to 32-bit and installed build-essential.
I then compiled and installed GMP-5.0.5, MPFR-3.1.1, MPC-1.0, ISL-0.10 and CLOOG-0.17.0. I checked out a copy of the main gcc trunk and attempted to build it with the following configure line (from a separate directory):
../svnsrc/configure --prefix=/usr/GCC/svn --enable-__cxa_atexit --with-plugin-ld=/usr/bin/ld.gold --enable-threads=posix --enable-werror --enable-build-with-cxx --with-gmp=/usr/GCC/prereq/svn --with-mpfr=/usr/GCC/prereq/svn --with-mpc=/usr/GCC/prereq/svn --with-isl=/usr/GCC/prereq/svn --with-cloog=/usr/GCC/prereq/svn --enable-languages=c,c++
Configure ran fine and so I ran make && make check. This ran fine for a while, but then it failed with the following error:
/home/matt/GCC/svnbuild/./gcc/xgcc -B/home/matt/GCC/svnbuild/./gcc/ -B/usr/GCC/svn/i686-pc-linux-gnu/bin/ -B/usr/GCC/svn/i686-pc-linux-gnu/lib/ -isystem /usr/GCC/svn/i686-pc-linux-gnu/include -isystem /usr/GCC/svn/i686-pc-linux-gnu/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -mlong-double-80 -I. -I. -I../.././gcc -I../../../svnsrc/libgcc -I../../../svnsrc/libgcc/. -I../../../svnsrc/libgcc/../gcc -I../../../svnsrc/libgcc/../include -I../../../svnsrc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../svnsrc/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
In file included from /usr/include/stdio.h:28:0,
from ../../../svnsrc/libgcc/../gcc/tsystem.h:88,
from ../../../svnsrc/libgcc/libgcc2.c:29:
/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory
#include <bits/predefs.h>
^
compilation terminated.
make[3]: *** [_muldi3.o] Error 1
make[3]: Leaving directory `/home/matt/GCC/svnbuild/i686-pc-linux-gnu/libgcc
I looked around, but everything I seemed to find was that this error was caused on x86_64, by not installing gcc-multilib, because Ubuntu and Debian use the mutiarch system, separating the libraries. Okay, fine...but I'm using i686, so why would I need the 64-bit libraries? Any help would be appreciated. Thanks.
Try doing a
sudo apt-get install gcc-multilib
I don't think that installing a 32-bit system changes the architecture of your computer, because your computer will always be a 64-bit machine. Installing the 64-bit version of Ubuntu should only give better multi-core performance. Since your computer is still a 64-bit computer, you probably need a C compiler that will compile on 64-bit machines. Hence the gcc-multilib. I think.
the gcc-multilib trick didn't work out for me. Instead, setting this in the build environment did the trick:
C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)

ld cannot find -l<library>

I am having trouble installing pyipopt on ubuntu 12.04. During linking, I receive the error:
/usr/bin/ld: cannot find -lcoinhsl
Even though I know that this library is installed and the .so and .la files are available in /home/mostafa/MyBuilds/CoinIpopt/build/lib/
does anyone have a solution for this?
below is the complete return of running setup.py build:
root#ubuntu:~/MyBuilds/pyipopt# sudo python setup.py build
running build
running build_ext
building 'pyipopt' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/home/mostafa/MyBuilds/CoinIpopt/build/include/coin/ -I/usr/include/python2.7 -c src/callback.c -o build/temp.linux-x86_64-2.7/src/callback.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/home/mostafa/MyBuilds/CoinIpopt/build/include/coin/ -I/usr/include/python2.7 -c src/pyipopt.c -o build/temp.linux-x86_64-2.7/src/pyipopt.o
src/pyipopt.c: In function ‘set_intermediate_callback’:
src/pyipopt.c:452:15: warning: variable ‘myowndata’ set but not used [-Wunused-but-set-variable]
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relrobuild/temp.linux-x86_64-2.7/src/callback.o build/temp.linux-x86_64-2.7/src/pyipopt.o -L/home/mostafa/MyBuilds/CoinIpopt/build/lib/ -lipopt -lblas -lcoinhsl -lcoinmetis -llapack -ldl -lm -o build/lib.linux-x86_64-2.7/pyipopt.so -Wl,--rpath -Wl,/home/mostafa/MyBuilds/CoinIpopt/build/lib/
/usr/bin/ld: cannot find -lcoinhsl
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
-Ldir
Add directory dir to the list of directories to be searched for -l.
You may install your coinhsl library in one of your standard libraries directories and run 'ldconfig` before doing your ppyipopt install
I had a similar problem with another library and the reason why it didn't found it, was that I didn't run the make install (after running ./configure and make) for that library. The make install may require root privileges (in this case use: sudo make install). After running the make install you should have the so files in the correct folder, i.e. here /usr/local/lib and not in the folder mentioned by you.
you can add the Path to coinhsl lib to LD_LIBRARY_PATH variable. May be that will help.
export LD_LIBRARY_PATH=/xx/yy/zz:$LD_LIBRARY_PATH
where /xx/yy/zz represent the path to coinhsl lib.

Resources