I want to install an old 2009 R tar.gz package in Windows 7, and have tried installing it using new and old versions of R (3.1.1 - output shown below, 2.7.0). This may not be pertinent to the solution, but I've set the path temporarily for R to recognize Rtools 31 using the code supplied in this solution.
I've seen this package used in recent journal articles so I know it's functional. If you would like to try installing this package it is available here.
Does anyone know how I can solve this cygwin warning, or Error: compilation failed problem/installation had non-zero exit status?
I really appreciate it, thank you very much!
> install.packages("cusp_2.2.tar.gz",type="source",repos=NULL,dependencies=TRUE)
* installing *source* package 'cusp' ...
** package 'cusp' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
cygwin warning:
MS-DOS style path detected: C:/PROGRA~1/R/R-31~1.1/etc/i386/Makeconf
Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-31~1.1/etc/i386/Makeconf
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
gcc -m32 -I"C:/PROGRA~1/R/R-31~1.1/include" -DNDEBUG - I"d:/RCompile/CRANpkg/extralibs64/local/include" -O3 -Wall -std=gnu99 -mtune=core2 -c cusp.nc.c -o cusp.nc.o
gcc: not found
make: *** [cusp.nc.o] Error 127
Warning: running command 'make -f "C:/PROGRA~1/R/R-31~1.1/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R- 31~1.1/share/make/winshlib.mk" SHLIB="cusp.dll" OBJECTS="cusp.nc.o"' had status 2
ERROR: compilation failed for package 'cusp'
* removing 'C:/Program Files/R/R-3.1.1/library/cusp'
Warning messages:
1: running command '"C:/PROGRA~1/R/R-31~1.1/bin/x64/R" CMD INSTALL -l "C:\Program Files\R\R-3.1.1\library" "cusp_2.2.tar.gz"' had status 1
2: In install.packages("cusp_2.2.tar.gz", type = "source", repos = NULL, :
installation of package ‘cusp_2.2.tar.gz’ had non-zero exit status
Session Info and Library Path information
> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
> .libPaths()
[1] "C:/Program Files/R/R-3.1.1/library"
Related
After upgrading python 3.8.6 to 3.9.10 using homebrew, my Cython extensions no longer without explicitly adding /usr/local/include (for my Intel MacBook) or /opt/homebrew/include to the include_dirs of my extension.
My setup.py.in:
import os, sys
from numpy.distutils.core import setup, Extension
from Cython.Build import cythonize
link_arguments = []
extra_include_dirs = []
if (sys.platform == 'darwin'):
link_arguments.append("-Wl,-rpath")
link_arguments.append("-Wl,#loader_path/")
if os.path.exists('/opt/homebrew/'):
extra_include_dirs.append("/opt/homebrew/include/")
else:
extra_include_dirs.append("/usr/local/include/")
else:
link_arguments.append("-Wl,-rpath=${CMAKE_SOURCE_DIR}/lib/")
pynwp_extension = Extension(
name="pynwp",
sources=["${CMAKE_CURRENT_SOURCE_DIR}/lambert.f90", "${CMAKE_CURRENT_SOURCE_DIR}/pynwp.f90", "${CMAKE_CURRENT_SOURCE_DIR}/readAtmosphereGen.f90", "${CMAKE_CURRENT_SOURCE_DIR}/ptogrot.f", "${CMAKE_CURRENT_SOURCE_DIR}/bilin1.f", "${CMAKE_CURRENT_SOURCE_DIR}/fl2pres_f.f","${CMAKE_CURRENT_SOURCE_DIR}/message.c","${CMAKE_CURRENT_SOURCE_DIR}/gridWindDirCorrection.F"],
libraries=["HirlamUtils_fPIC", "eccodes_f90", "jasper"],
library_dirs=["${PROJECT_BINARY_DIR}", "${CMAKE_SOURCE_DIR}/build${CMAKE_BUILD_TYPE}/src/libHirlamUtils/", "/opt/homebrew/lib/"],
extra_link_args = link_arguments,
include_dirs=["${CMAKE_SOURCE_DIR}/include", "/usr/lib64/gfortran/modules/",
"${CMAKE_SOURCE_DIR}/build${CMAKE_BUILD_TYPE}"] + extra_include_dirs,
extra_f90_compile_args=["-DLINUX", "-DIS_LITTLE_ENDIAN", "-DUSEWALLTIME", "-DHAS_BLAS", "-DHAS_LAPACK", "-DGRIB32", "-DTIMING", "-DPREC32", "-fno-whole-file", "-g", "-fbounds-check"]
#compiler_directives={'language_level' : "3"}
)
setup(name="pynwp",
author="me",
author_email="me!me.com",
version="1.0.1",
description="Python wrapper for pynwp",
package_dir={"": "${CMAKE_CURRENT_SOURCE_DIR}"},
url="http://emaddc.eu",
license="MIT License",
ext_modules=[pynwp_extension]
)
In the file above, I have hardcoded the location (temporarily) of the homebrew library dir and added some functionality for the include dir based on /opt/homebrew being found. If I remove this from the file, compilation fails as eccodes.mod cannot be found, see the output when I run the command generate by python/CMake manually:
buildDebug git:(master) ✗ /opt/homebrew/bin/gfortran -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops -I<project_dir>//include -I/usr/lib64/gfortran/modules/ -I<project_dir>//buildDebug -Ibuild/src.macosx-12-arm64-3.9/build/src.macosx-12-arm64-3.9 -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -Ibuild/src.macosx-12-arm64-3.9/numpy/distutils/include -I/opt/homebrew/opt/python#3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c -c <project_dir>//src/pynwp/readAtmosphereGen.f90 -o build/temp.macosx-12-arm64-3.9<project_dir>//src/pynwp/readAtmosphereGen.o -DLINUX -DIS_LITTLE_ENDIAN -DUSEWALLTIME -DHAS_BLAS -DHAS_LAPACK -DGRIB32 -DTIMING -DPREC32 -fno-whole-file -g -fbounds-check
f951: Warning: Nonexistent include directory '/usr/lib64/gfortran/modules/' [-Wmissing-include-dirs]
f951: Warning: Nonexistent include directory 'build/src.macosx-12-arm64-3.9/build/src.macosx-12-arm64-3.9' [-Wmissing-include-dirs]
f951: Warning: Nonexistent include directory 'build/src.macosx-12-arm64-3.9/numpy/distutils/include' [-Wmissing-include-dirs]
<project_dir>//src/pynwp/readAtmosphereGen.f90:3:7:
3 | use eccodes
| 1
Fatal Error: Cannot open module file 'eccodes.mod' for reading at (1): No such file or directory
compilation terminated.
This extension is part of a larger project that is build using CMake. When running the gfortran command manually, the same errors indicating that eccodes.mod cannot be found. The file is however located on a default location on the gfortran/gcc search path:
locate eccodes.mod
/opt/homebrew/Cellar/eccodes/2.24.2/include/eccodes.mod
/opt/homebrew/include/eccodes.mod
And the search path for gfortran:
gfortran -E -Wp,-v -
#include <...> search starts here:
/opt/homebrew/include
/opt/homebrew/Cellar/gcc/11.2.0_3/bin/../lib/gcc/11/gcc/aarch64-apple-darwin21/11/include
/opt/homebrew/Cellar/gcc/11.2.0_3/bin/../lib/gcc/11/gcc/aarch64-apple-darwin21/11/include-fixed
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks
End of search list.
Another project uses gcc/ld and has a similar problem. I need to explicitly add LINK_DIRECTORIES(/opt/homebrew/lib) to CMakeList.txt in order for gcc to find the eccodes library. Without that, I get:
gcc-11: warning: this compiler does not support X86 (arch flags ignored)
ld: library not found for -leccodes
collect2: error: ld returned 1 exit status
make[2]: *** [src/smoothModeS-v51/smoothModeS-v51.x] Error 1
make[1]: *** [src/smoothModeS-v51/CMakeFiles/smoothModeS-v51.x.dir/all] Error 2
make: *** [all] Error 2
Adding the paths to CPATH and LIBRARY_PATH had no effect.
This method works but seems hard to maintain. What am I missing and what has changed that gfortran/gcc no longer search in the default paths for but libraries and headers/modules?
EDIT
Just found that the standalone executable that uses similar code as the python extension and also uses eccodes has a similar issue. If I do not include INCLUDE_DIRECTORIES(/opt/homebrew/include) in CMakeLists.txt , I get:
cd <project_dir>/buildDebug/src/collocEHS && /opt/homebrew/bin/gfortran -I<project_dir>/buildDebug -I<project_dir>/include -I<project_dir>/src/readASTERIX2 -I<project_dir>/src/geomag70_linux -I<project_dir>/src/libDTG -fallow-argument-mismatch -ffpe-trap=invalid,zero,overflow -DPREC32 -DLINUX -DIS_LITTLE_ENDIAN -DUSEWALLTIME -DHAS_BLAS -DHAS_LAPACK -DGRIB32 -DTIMING -ffixed-line-length-none -g -fcheck=all -Wall -fcheck=bounds -O0 -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -c <project_dir>/src/pynwp/readAtmosphereGen.f90 -o CMakeFiles/collocEHSv2.dir/__/pynwp/readAtmosphereGen.f90.o
<project_dir>/src/pynwp/readAtmosphereGen.f90:3:7:
3 | use eccodes
| 1
Fatal Error: Cannot open module file 'eccodes.mod' for reading at (1): No such file or directory
compilation terminated.
make[2]: *** [src/collocEHS/CMakeFiles/collocEHSv2.dir/__/pynwp/readAtmosphereGen.f90.o] Error 1
make[1]: *** [src/collocEHS/CMakeFiles/collocEHSv2.dir/all] Error 2
make: *** [all] Error 2
So I guess the problem is unrelated to python but more with gcc/gfortran (gcc version 11.2.0 (Homebrew GCC 11.2.0_3).
EDIT 2
A reboot of the laptop fixed the issue with the python extension build and setup.py requiring additional directories. For normal builds using CMake, I still require the extra INCLUDE_DIRECTORIES and LINK_DIRECTORIES order for gcc/gfortran to find libraries installed by brew in /opt/homebrew (or /usr/local for intel MacBook).
As per homebrew devs, this is desired behaviour: /opt/homebrew and /usr/local are "special" directories to be manually added in e.g., CMake projects. This is explained in my bug report on home-brew's GitHub, see https://github.com/Homebrew/homebrew-core/issues/95561.
I haven't been able to confirm this with documentation.
I am using Ubuntu 18.04.2 LTS under windows 10 by using "Windows subsystem for Linux." I am experiencing some issues with XV6.
I set up XV6 by using the command:
git clone git://pdos.csail.mit.edu/xv6/xv6.git
sudo apt-get install libc6-dev
chmod 700 -R xv6-riscv
But when I typed in make command, I having the following issue:
***
*** Error: Couldn't find an riscv64 version of GCC/binutils.
*** To turn off this error, run 'gmake TOOLPREFIX= ...'.
***
gcc -c -o kernel/entry.o kernel/entry.S
kernel/entry.S: Assembler messages:
kernel/entry.S:17: Error: no such instruction: `la sp,stack0'
kernel/entry.S:18: Error: no such instruction: `li a0,1024*4'
kernel/entry.S:19: Error: no such instruction: `csrr a1,mhartid'
kernel/entry.S:20: Error: no such instruction: `addi a1,a1,1'
kernel/entry.S:21: Error: too many memory references for `mul'
kernel/entry.S:22: Error: too many memory references for `add'
kernel/entry.S:26: Error: no such instruction: `j junk'
<builtin>: recipe for target 'kernel/entry.o' failed
make: *** [kernel/entry.o] Error 1
Can anyone help me with this? (I am using an x64 system)
you should check this link: https://pdos.csail.mit.edu/6.828/2019/tools.html
for me I am running ubuntu, so I compiled the toolchain myself and then it works
I was running MacOS and had the same error. I solved it by updating the ~/.bashrc with:
PATH=$PATH:/usr/local/opt/riscv-gnu-toolchain/bin
before sourcing it or open a new interactive session. Then make qemu under xv6-riscv just ran!
So I would suggest you go back and check if you've finished each step: install toolchain, update env vars, source, and make.
For Suse you can install cross-riscv64-gccX package, where X is the gcc version
Then use
TOOLPREFIX=/usr/bin/riscv64-suse-linux-
it worked for me
I have followed the instruction in:
https://gist.github.com/notilas/a30e29ce514970e821a34153c1e78b3f
But cannot complete it.
OSX: Sierra
Tensorflow version 1.1.0 (Google says v1.2 does not support OSX CUDA)
CUDA Tool kit : 8.0
CUDNN : 6.0
Xcode : 7.2.1
Anaconda : 4.2 (Python version 3.5)
Error Log:
ERROR: /Users/so041e/ml/tensorflow/tensorflow/python/BUILD:2534:1:
Linking of rule '//tensorflow/python:_pywrap_tensorflow_internal.so'
failed: link_dynamic_library.sh failed: error executing command
external/bazel_tools/tools/cpp/link_dynamic_library.sh no ignored
ignored ignored
external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc
-shared -o ... (remaining 455 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process
exited with status 1.
clang: warning: argument unused during compilation: '-pthread'
ld: file not found: #rpath/CUDA.framework/Versions/A/CUDA for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
[.bash_profile]
export PATH="/Users/so041e/anaconda/bin:$PATH"
export CUDA_HOME=/usr/local/cuda
export HOME=/Users/so041e
export PATH="$CUDA_HOME/bin:$PATH"
export DYLD_LIBRARY_PATH="/usr/local/cuda/lib:/Developer/NVIDIA/CUDA8.0/lib":$DYLD_LIBRARY_PATH
export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
export PATH=$DYLD_LIBRARY_PATH:$PATH
export PATH="//anaconda/bin:$PATH"
Moved CUDNN lib and include to /user/local/cuda
sudo mv -v cuda/lib/libcudnn* /usr/local/cuda/lib
sudo mv -v cuda/include/cudnn.h /usr/local/cuda/include
Didn't use "vent" Just used single python 3.5 at this moment.
Tried both, but no difference.
bazel build --config=cuda --config=opt --action_env PATH --action_env LD_LIBRARY_PATH --action_env DYLD_LIBRARY_PATH //tensorflow/tools/pip_package:build_pip_package
bazel build --config=cuda //tensorflow/tools/pip_package:build_pip_package
This might be a bit late, but I had this exact same problem and I managed to fix it.
First, #rpath/CUDA.framework/Versions/A/CUDA is a dynamic library install name for libcuda.dylib, which is found in /usr/local/cuda/lib. So do
otool -l /usr/local/cuda/lib/libcuda.dylib
Check where you see #rpath/CUDA.framework/Versions/A/CUDA; on my system it was in the command LC_REEXPORT_DYLIB. From here, it seems dyld doesn't resolve the #rpath for the LC_REEXPORT_DYLIB command, only LC_LOAD*_DYLIB commands. Meaning, it looks for the literal path "#rpath/CUDA.framework/Versions/A/CUDA". So you're going to have to change that by doing
sudo install_name_tool -change #rpath/CUDA.framework/Versions/A/CUDA \
/Library/Frameworks/CUDA.framework/Versions/A/CUDA \
/usr/local/cuda/lib/libcuda.dylib
This should resolve your problem.
Now why your system (and mine) has this install name for libcuda.dylib? I have absolutely no clue.
I will submitting my package to CRAN. I have already built with R 3.2.4 and I now am trying to build on R-devel 3.4.0 before submitting to CRAN as required. I am having problems installing packages. I have installed Rtools33.exe for Windows. But I get an errors when installing the following packages - devtools, dplyr, ggplot2 etc. Here are the errors for devtools
> install.packages("devtools")
also installing the dependencies ‘mime’, ‘openssl’, ‘httr’, ‘memoise’, ‘digest’, ‘jsonlite’, ‘git2r’
* installing *source* package 'mime' ...
** package 'mime' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
d:/Compiler/gcc-4.9.3/mingw_32/bin/gcc -I"C:/software/R/R- DEVE~1/include" -DNDEBUG -I"d:/Compiler/gcc-4.9.3/local330/include" -O3 -Wall -std=gnu99 -mtune=core2 -c rawmatch.c -o rawmatch.o
d:/Compiler/gcc-4.9.3/mingw_32/bin/gcc: not found
make: *** [rawmatch.o] Error 127
Warning: running command 'make -f "C:/software/R/R-DEVE~1/etc/i386/Makeconf" -f "C:/software/R/R-DEVE~1/share/make/winshlib.mk" SHLIB="mime.dll" OBJECTS="rawmatch.o"' had status 2
ERROR: compilation failed for package 'mime'
* removing 'C:/software/R/R-devel-Mar30/library/mime'
Warning in install.packages :
running command '"C:/software/R/R-DEVE~1/bin/x64/R" CMD INSTALL -l "C:\software\R\R-devel-Mar30\library" C:\Users\Ganesh\AppData\Local\Temp\Rtmpq4DzNw/downloaded_packages/mime_0.4.tar.gz' had status 1
Warning in install.packages :
installation of package ‘mime’ had non-zero exit status
* installing *source* package 'openssl' ...
** package 'openssl' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
"C:/software/R/R-DEVE~1/bin/i386/Rscript.exe" "../tools/winlibs.R"
d:/Compiler/gcc-4.9.3/mingw_32/bin/gcc -I"C:/software/R/R-DEVE~1/include" -DNDEBUG -I../windows/openssl-1.0.2d/include -I"d:/Compiler/gcc-4.9.3/local330/include" -O3 -Wall -std=gnu99 -mtune=core2 -c win32/ipv6.c -o win32/ipv6.o
d:/Compiler/gcc-4.9.3/mingw_32/bin/gcc: not found
make: *** [win32/ipv6.o] Error 127
Warning: running command 'make -f "Makevars.win" -f "C:/software/R/R- DEVE~1/etc/i386/Makeconf" -f "C:/software/R/R-DEVE~1/share/make/winshlib.mk" SHLIB="openssl.dll" OBJECTS="aes.o base64.o bignum.o cert.o envelope.o error.o hash.o info.o keygen.o onload.o openssh.o rand.o read.o rsa.o signing.o ssl.o stream.o write.o"' had status 2
ERROR: compilation failed for package 'openssl'
* removing 'C:/software/R/R-devel-Mar30/library/openssl'
Warning in install.packages :
running command '"C:/software/R/R-DEVE~1/bin/x64/R" CMD INSTALL -l "C:\software\R\R-devel-Mar30\library" C:\Users\Ganesh\AppData\Local\Temp\Rtmpq4DzNw/downloaded_packages/openssl_0.9.2.tar.gz' had status 1
Warning in install.packages :
installation of package ‘openssl’ had non-zero exit status
* installing *source* package 'digest' ...
** package 'digest' successfully unpacked and MD5 sums checked
** libs
Similar errors regarding gcc occurs. Please let me know what needs to be done
Since R 3.4.0 is still in early development stages the errors are expected. This is the response I got from CRAN. As of now we need to build on a more stable R 3.3.0
I have a similar issue to this question PyTables does not seem to acknowledge hdf5 though it is evidently installed. Here is a slightly abbreviated error message from pip.
(And I'm going to ramble a bit more just because I get the annoying "this is mostly code" warning.)
pip install --upgrade h5py
Requirement already up-to-date: h5py in /Library/Python/2.7/site-packages
Cleaning up...
$ pip install --upgrade tables
Downloading/unpacking tables
Downloading tables-3.1.1.tar.gz (6.7MB): 6.7MB downloaded
ld: library not found for -lhdf5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
* Using Python 2.7.5 (default, Mar 9 2014, 22:15:05)
* Found numpy 1.9.0 package installed.
* Found numexpr 2.4 package installed.
* Found Cython 0.21 package installed.
ld: library not found for -lhdf5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
.. ERROR:: Could not find a local HDF5 installation.
You may need to explicitly state where your local HDF5 headers and
library can be found by setting the ``HDF5_DIR`` environment
variable or by using the ``--hdf5`` command-line option.
Complete output from command python setup.py egg_info:
/var/folders/0w/y_9w4kq53pqfgrc72bb7cml40000gn/T/H5closekvR8zE.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
ld: library not found for -lhdf5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
* Using Python 2.7.5 (default, Mar 9 2014, 22:15:05)
* Found numpy 1.9.0 package installed.
* Found numexpr 2.4 package installed.
* Found Cython 0.21 package installed.
ld: library not found for -lhdf5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
.. ERROR:: Could not find a local HDF5 installation.
You may need to explicitly state where your local HDF5 headers and
library can be found by setting the ``HDF5_DIR`` environment
variable or by using the ``--hdf5`` command-line option.