First time post so my apologies for any posting taboos I violate.
I am following the installation instructions here: http://web.stanford.edu/~hastie/glmnet/glmnet_alpha.html with one small exception: I have obtained a tar ball and am installing from a local directory rather than a cran mirror. (I have attempted both)
I am working on a shared unix environment that I do not have sudo access to.
Using this command install.packages("full/path_to_tar/glmnet_1.9-8.tar.gz", "full/path_to_local_libs/R_libs") in R resulted in the following error:
installing *source* package ‘glmnet’ ...
This package requires a fortran 90 compiler. We assume
that your fortran 90 environment is set up appropriately.
Reference: Section on 'Using F95 code' in R-exts manual.
R_HOME is /usr/pkgs/R/2.12.0/lib64/R
R configured for gfortran...
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gfortran -fdefault-real-8 -ffixed-form -fpic -g -O -c glmnet5.f90 -o glmnet5.o
makeList item: gfortran: Command not found
I referred to the reference and found that updating my PATH to use gcc.4.8.1 would alleviate this problem. I did so.
Retrying the same command resulted in the following:
installing *source* package ‘glmnet’ ...
This package requires a fortran 90 compiler. We assume
that your fortran 90 environment is set up appropriately.
Reference: Section on 'Using F95 code' in R-exts manual.
R_HOME is /usr/pkgs/R/2.12.0/lib64/R
R configured for gfortran...
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gfortran: error: unrecognized command line option ‘-rpath=/usr/pkgs/X11/R7.3-64/lib:[...]:/usr/pkgs/R/2.12.0/lib’
make: *** [glmnet.so] Error 1
ERROR: compilation failed for package ‘glmnet’
I am aware that -rpath is a valid gcc option, but I am not sure exactly why the -rpath option is being passed to gfortran, or why it is failing as a result.
Any advice would be very helpful!
Related
I'm trying to upgrade my micronuclues to upload my code to digispark,but when I try to upgrade that happens:
Building command line tool: micronucleus...
gcc -Ilibrary -O -g -D LINUX -o micronucleus micronucleus.c micronucleus_lib.o littleWire_util.o -static -L/usr/lib/x86_64-linux-gnu -lusb
/usr/bin/ld: cannot find -lusb
collect2: error: ld returned 1 exit status
make: *** [Makefile:61: micronucleus] Error 1
I'm a little confused as to how you've gotten it compiling but not linking because, at least on Debian based distributions, the header file that would be needed during compiling is provided by the same package that provides the libusb.a that it is failing to link against.
If you are on a Debian based distro, try (re)installing libusb-dev:
sudo apt install libusb-dev
This is what I've built it against locally.
If you have a libusb.a and it's not in /usr/lib/x86_64-linux-gnu, then you'd need a different directory supplied to -L.
I am compiling my binary on a Raspberry device but when I move it to another one I get the following error:
./iot-relay
./iot-relay: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory`
I've come to the conclusion that compiling a fully statically linked binary may help so I start reading about this here
Adding the target that I guess is appropriate:
rustup target add armv7-unknown-linux-musleabihf
And attempting to compile:
cargo build --release --target armv7-unknown-linux-musleabihf
It compiles most of the stuff but then:
error: failed to run custom build command for `paho-mqtt-sys v0.3.0`
Caused by:
process didn't exit successfully: `/home/pi/rust/iot-relay/target/release/build/paho-mqtt-sys-9d34dbf9179b933d/build-script-build` (exit code: 101)
--- stdout
debug:Running the bundled build for Paho C
cargo:rerun-if-changed=build.rs
running: "cmake" "/home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/paho-mqtt-sys-0.3.0/paho.mqtt.c/" "-DPAHO_BUILD_SHARED=off" "-DPAHO_BUILD_STATIC=on" "-DPAHO_ENABLE_TESTING=off" "-DPAHO_WITH_SSL=on" "-DCMAKE_INSTALL_PREFIX=/home/pi/rust/iot-relay/target/armv7-unknown-linux-musleabihf/release/build/paho-mqtt-sys-964264b133c84ace/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -march=armv7-a" "-DCMAKE_C_COMPILER=arm-linux-musleabihf-gcc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -march=armv7-a" "-DCMAKE_CXX_COMPILER=arm-linux-musleabihf-g++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -march=armv7-a" "-DCMAKE_ASM_COMPILER=arm-linux-musleabihf-gcc" "-DCMAKE_BUILD_TYPE=Release"
-- The C compiler identification is unknown
-- Configuring incomplete, errors occurred!
See also "/home/pi/rust/iot-relay/target/armv7-unknown-linux-musleabihf/release/build/paho-mqtt-sys-964264b133c84ace/out/build/CMakeFiles/CMakeOutput.log".
See also "/home/pi/rust/iot-relay/target/armv7-unknown-linux-musleabihf/release/build/paho-mqtt-sys-964264b133c84ace/out/build/CMakeFiles/CMakeError.log".
--- stderr
fatal: not a git repository (or any of the parent directories): .git
CMake Error at CMakeLists.txt:21 (PROJECT):
The CMAKE_C_COMPILER:
arm-linux-musleabihf-gcc
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1
build script failed, must exit now', /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/cmake-0.1.44/src/lib.rs:885:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
How can I fix this and get my statically linked binary that would work on my other Raspberry? Unfortunately, the one that can't run the binary is a custom one and has some custom software that prevents me from doing system updates so I am hoping to pack everything required into the binary on the one over which I do have control.
This is cargo looking to follow build instructions to for a C dependency and not finding the gcc supporting the specified toolchain. You may need to find the correct location and name for your gcc targeting your environment (CC=). If you don't have a cross compiler for that target and musl libc combo, you may have to build one. See the link below for info on how to do that.
https://wiki.musl-libc.org/getting-started.html
I am trying to compile my game program and it s giving me this
root#vps:/usr/src/Sursa/Server/source/game/src # gmake -j20
linking ../game
ld: error: unable to find library -lmysqlclient
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [Makefile:228: ../game] Error 1
root#vps:/usr/src/Sursa/Server/source/game/src #
This is my Makefile path for library
# mysql
INCDIR += -I../../../extern/mysql
LIBDIR += -L/usr/local/lib/mysq
LIBS += -lmysqlclient -lz -pthread -lm -lssl -lcrypto
### END
You need to update your GCC compiler since some features of c++14 is not supported by gcc4.9.
You can search the available packages in FreeBSD using
pkg search <package_name>
and install whatever you want via
pkg install <package_name>
Note : you might need sudo before those commands if your current user is not root
Finally if you have problems such as
Fatal error : "some_file"."some_extension" file not found
you can search the package name via the aforementioned command and install them in order to compile successfully.
For example to mitigate the following error
fatal error: 'boost/intrusive_ptr.hpp' file not found
you can install the boost-libs package.
I am trying to compile hidapi library. In order to compile that, I need libusb-1.0. I've downloaded that, configured, made and installed to /usr/local/lib. But when I try to compile hidapi, it doesn't see libusb-1.0:
cc -Wall -g -c -I../hidapi pkg-config libusb-1.0 --cflags
hid-libusb.c -o hid-libusb.o -L/usr/local/lib Package libusb-1.0 was
not found in the pkg-config search path. Perhaps you should add the
directory containing `libusb-1.0.pc' to the PKG_CONFIG_PATH
environment variable No package 'libusb-1.0' found /bin/sh: cc: not
found make: * [hid-libusb.o] Error 127
How can I fix that?
(compilation happens on Synology NAS)
Since you installed to /usr/local/lib, pkg-config will not find your installation unless you set PKG_CONFIG_PATH appropriately
Try running:
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"
in your shell and then re-attempting to build your code
I'm trying to compile a very old verion of slapd (the LDAP server) on cygwin. Previously this ran on a Linux box, but for reasons beyond my control it must be made to work on a Windows server. It has been suggested that we might use cygwin to compile up the source-code.
Unfortunately the build fails during "configure" with the error message:
checking how to run the C preprocessor... cc -E
checking for gcc... (cached) cc
checking whether the C compiler (cc ) works... no
configure: error: installation or configuration problem: C compiler cannot creat
e executables.
The last few lines of config.log are:
configure: failed program was:
#line 2822 "configure"
#include "confdefs.h"
int main() {
return __EMX__;
; return 0; }
configure:2845: checking how to run the C preprocessor
configure:2866: cc -E conftest.c >/dev/null 2>conftest.out
configure:2950: checking for gcc
configure:3063: checking whether the C compiler (cc ) works
configure:3079: cc -o conftest conftest.c 1>&5
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find
-luser32
collect2: ld returned 1 exit status
configure: failed program was:
#line 3074 "configure"
#include "confdefs.h"
main(){return(0);}
UPDATE: This is a win32 computer - cygwin does not included a shared-object called user32, but Windows XP does include an object called user32.dll - any idea if this might be what the linker is looking for?
UPDATE2: w32api is already installed, (3.13-1) - I note that there is a user32.lib as part of visual-stuido 2003 .Net - is there a way to make GCC in Cygwin use this?
The root cause seems to be
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -luser32
This is either a problem with your cygwin installation, or the configure scripts are to old to recognise and handle the installation.
If -luser32 is failing, try installing the w32api Cygwin package.
After much trial & error I found the correct answer for this problem: The reason for this error is that the Cygwin environment was not set up correctly.
The login-user on a domain, and so the /etc/passwd & /etc/group files were not set up correctly by default. The solution was to make a local user-account and then re-build the passwd and groups files.
After that, GCC could build just fine.
Sounds crazy, I know.