I am trying to compile node.js on openindiana, below is my Environment,
Even I set gcc path in .profile
It keeps saying
No acceptable C compiler found!
export PATH=/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin:/opt/gcc/4.4.4/bin:/usr/gnu/bin:$PATH
export PAGER="/usr/bin/less -ins"
export CC=/opt/gcc/4.4.4/bin/gcc
export cc=/opt/gcc/4.4.4/bin/gcc
run
$ CC=gcc ./configure --with-dtrace --dest-cpu=x64 --prefix=~/local
or
$ ./configure --with-dtrace --dest-cpu=x64 --prefix=~/local
both of them gives following error
Node.js configure error: No acceptable C compiler found!
Please make sure you have a C compiler installed on your system and/or
consider adjusting the CC environment variable if you installed
it in a non-standard prefix.
nick#www:~/node-latest-install$ echo $PATH
/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin:/opt/gcc/4.4.4/bin/gcc
nick#www:~/node-latest-install$ which gcc
/usr/bin/gcc
nick#www:~/node-latest-install$ which cc
which: no cc in (/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin:/opt/gcc/4.4.4/bin/gcc)
nick#www:~/node-latest-install$ gcc -v
Using built-in specs.
Target: i386-pc-solaris2.11
Configured with: /home/jt/OI-151A-STABLE/151A-PRESTABLE6/newbuilds/oi-build/components/illumos-gcc/richlowe-gcc-f268959/configure --prefix=/opt/gcc/4.4.4 --with-gnu-as --with-as=/usr/sfw/bin/gas --with-ld=/usr/bin/ld --without-gnu-ld --enable-languages=c,c++,objc --enable-shared --with-mpfr-include=/usr/include/mpfr --with-gmp-include=/usr/include/gmp
Thread model: posix
gcc version 4.4.4 (GCC)
if you specify CC variable, make it absolute path to gcc: CC=/opt/gcc/4.4.4/bin/gcc. But if compiler is already in PATH, specifying CC shouldn't be necessary.
This may sound like a stupid answer but have you tried removing it and re-installing it from package manager. GCC that is
Also when did the problem start occurring? You could use beadm to roll back the OS to the last update or to when you created a 'Restore Point' so to speak. Check it out, very useful thing to use before running installs.
Related
I've been struggling with this issue for several weeks now, working it off and on. I've got Ubuntu running on Windows. I also installed OpenFOAM to analyze CFD simulations. My issue is the default the gcc called at the command prompt is the OpenFOAM one.
$ gcc --version
gcc (OpenFOAM) 6.3.0
I needed updated libraries installed for something else I'm working on. I managed to get all the libraries installed, but linux is still looking to the OpenFOAM version of gcc (which doesn't see the libraries) when I run the program at the command prompt. I am calling a shell scrip that in turns calls other programs, so I cannot determine a way to directly call out the full path to the desired gcc version.
I've worked out that the bash gcc command is actually linked to three versions of gcc:
$ type -a gcc
gcc is /opt/OpenFOAM/OpenFOAM-v2012/ThirdParty/platforms/linux64/gcc-6.3.0/bin/gcc
gcc is /usr/bin/gcc
gcc is /bin/gcc
This leads me to believe that the shell scrip is going to the first one and ignoring the next two. How do I get it to go to the second?
i.e. so terminal would return
gcc is /usr/bin/gcc
gcc is /bin/gcc
gcc is /opt/OpenFOAM/OpenFOAM-v2012/ThirdParty/platforms/linux64/gcc-6.3.0/bin/gcc
This should yield the correct version of gcc being called and the installed libraries I need to be referenced at runtime.
$ which gcc
/opt/OpenFOAM/OpenFOAM-v2012/ThirdParty/platforms/linux64/gcc-6.3.0/bin/gcc
I was expecting this to return /usr/bin/gcc instead.
I tried appending the /bin/gcc/ to the front of the path variable:
$ export PATH = /usr/bin/:$PATH
without success. (edited for syntax)
I also researched installing multiple versions of gcc on Ubuntu and worked out there is a command that should permit me to do what I'm trying to, but it doesn't work:
$ sudo update-alternatives --config gcc
update-alternatives: error: no alternatives for gcc
I was expecting to be able to select which version of gcc was called.
Thanks for rici's input:
$ export PATH=/usr/bin:$PATH
prepended '/usr/bin' to the path variable before all the OpenFOAM stuff.
$ type -a $PATH
returned
gcc is /usr/bin/gcc
gcc is /opt/OpenFOAM/OpenFOAM-v2012/ThirdParty/platforms/linux64/gcc-6.3.0/bin/gcc
gcc is /usr/bin/gcc
gcc is /bin/gcc
This should have resolved my issue except for some reason it's still looking for another library in the OpenFOAM directories. As for the original question, the matter is resolved.
I am trying to build a Rust app and I get the below when trying to build. This happened after I installed ndarray-linalg and ndarray.
I installed gcc and openvc. I am on macOS.
= note: ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How do I resolve this?
which gfortran
/usr/local/bin/gfortran
I found the library here:
ls /usr/local/Cellar/gcc/8.2.0/lib/gcc/8/libgfortran.*
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/libgfortran.5.dylib
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/libgfortran.dylib
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/libgfortran.a
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/libgfortran.spec
ldconfig -p | grep fortran
-bash: ldconfig: command not found
And also ran the below:
brew reinstall gcc
How can I make sure Rust will find it?
Check first if any of the env variables are set
DYLD_LIBRARY_PATH
DYLD_FALLBACK_LIBRARY_PATH
These variables tell the compiler where to look for libraries installed on the system. Built-in libraries are usually placed in /usr/lib, and homebrew places them in /usr/local/lib. So these should be in your lib path.
If for some reason you cant find your library there you can try
export DYLD_LIBARY_PATH=$DYLD_LIBARY_PATH:/usr/local/Cellar/gcc/8.2.0/lib/gcc/8
and if that does not work try with the other variables.
I am on Debian 8 (Jessie), 64 Bit. I installed libxml2-dev, which now sits in /usr/include/libxml2/libxml.
But when I do (just like libxml docs say)
#include <libxml/parser.h>
I only get when compiling (with gcc)
fatal error: libxml/parser.h: no such file or directory
Notes: On another machine, with an old 64 Bit Suse, where libxml2-dev sits in the exact same path and no other environment vars are set compared to the new Debian, it works perfectly fine. Problem occured while migrating from one to another computer using the exact same makefiles. All other -dev libs that I need just worked (with their documented #include <path>) after the migration (they were all installed with apt-get), only libxml2-dev is not found on compilation.
Do I need to do anything else to make libxml2-dev visible?
if you installed it: sudo apt-get install libxml2-dev libxml2-doc go into /usr/include/libxml2 and copy or move all content from that folder on a level below: cp -R libxml/ ../ After this for me it works.
Try to compile with explicite inclusion where the parser.h file is, i.e. smth like this
g++ -I/usr/include/libxml2/
Following environment variables can also be used for lookup of header files
CPATH
C_INCLUDE_PATH
CPLUS_INCLUDE_PATH
OBJC_INCLUDE_PATH
Find more information here
I came across this same problem on a Centos system. I resolved it by doing the following:
yum install libxml2-devel
cd /usr/include
ln -s libxml2/libxml .
That was it. No change to environment variables or compiler switches.
You should use pkg-config to pass parameters to compiler. Like this
g++ `pkg-config --cflags libxml-2.0` example.c -o example.o
and to linker:
g++ `pkg-config --libs libxml-2.0` example.o -o example
I am required to use LLVM and Clang for a compilers class I am enrolled in. This is not a question about the content of the class, just how to get the required software installed.
I am running gcc version 4.6.3 and have downloaded, built, tested, and updated what I believe to be LLVM suite version 3.4 (the latest svn edition). I do a simple "hello world" application, as referenced on the LLVM getting started page, but on the line
lli helloworld.bc
I get the error "lli:helloworld.bc: Invalid MODULE_CODE_GLOBALVAR record"
Here are the instructions I ran in the terminal, most of which was taken directly from the LLVM website:
cd myFolder
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd myFolder
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd myFolder
cd llvm/projects
svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
cd myFolder
mkdir build
cd build
../llvm/configure --enable-optimized CC=/usr/bin/clang CXX=/usr/bin/clang++
make
make check-all
make update
THEN
clang hello.c -o hello
clang -03 -emit-llvm hello.c -c -o hello.bc
lli hello.bc
And that final line, lli hello.bc, is where I get the error above.
Here are my questions:
What is installed on my machine? How do I resolve this error?
My professor said we need clang and LLVM 3.3. How can I get LLVM 3.3?
When you typed:
clang -03 -emit-llvm hello.c -c -o hello.bc
You used the system's clang executable, which is at /usr/bin/clang, and is not the clang you have just built. The two have a different version. lli, however, is the lli you've just built - Ubuntu doesn't come with it. That means you have generated a .bc file with an older LLVM version and then tried to run it with a newer LLVM version, hence the problem.
To verify this, you can check which clang you are using by typing which clang into the console.
The simplest way to remedy this is to type ./clang (or any other path which isn't just the file name) instead of clang, which forces the shell to choose the file in the current directory.
I have never done any major programing outside of VS08.
I am trying to compile a program called LAMMPS with either of the two relevant make files. One calls g++ and the other calls icc (Intel's compiler).
icc produces this error:
icc -O -DLAMMPS_GZIP -DMPICH_SKIP_MPICXX -DFFT_FFTW -M write_restart.cpp > write_restart.d
write_restart.cpp(15): catastrophic error: cannot open source file "mpi.h"
#include "mpi.h"
and g++ throws this error
g++ -g -O -DLAMMPS_GZIP -DMPICH_SKIP_MPICXX -DFFT_FFTW -M verlet.cpp > verlet.d
pointers.h:25: fatal error: mpi.h: No such file or directory
compilation terminated.
The mpi.h file is located in /usr/lib/openmpi/include
It is my understanding that I need to set that $PATH variable which reads
bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/opt/intel/bin:/usr/lib/openmpi/include:
and $LD_LIBRARY_PATH which currently reads
/usr/lib/openmpi/lib:
SO, how does one include the mpi.h file? So that either icc or g++ find it?
mpi.h is a header for MPI library. That would be included if you use mpic++ MPI compiler wrapper instead of g++ in your makefile. mpic++ will call the appropriate compiler. From what you describe you have openmpi package installed on your ubuntu machine.
For more info, you need to consult the manual, e.g.
http://lammps.sandia.gov/doc/Section_start.html#2_2 (for LAMMPS)
and perhaps you need to see openmpi manual as to how to set up additional compiler. Not sure if this can be done after openmpi itself has been built. By default I think in Ubuntu openmpi compiler wrappers would only call g++. CMIIW.
Okay, so I got it to work with g++ when setting up cc as "mpic++.mpich2" instead of "mpic++"
you can try compile using openmpi make file in /src/MAKE
make openmpi
in my case, this option was successful