Why is my MakeFile path setup getting a "No such file or directory" error? - tensorflow

I am trying to run a makefile. I think the makefile is trying to access this path:
/home/s/miniconda3/lib/python3.7/site-packages/tensorflow/include/unsupported/Eigen
But when I run it, I get a No such file or directory error:
(base) s#s-VirtualBox:~/Downloads/3d-psrnet-master$ make
make: Circular utils/tf_ops/cd/tf_nndistance_g.cu <- utils/tf_ops/cd/tf_nndistance_g.cu.o dependency dropped.
/usr/local/cuda-10.1/bin/nvcc -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 -c -o utils/tf_ops/cd/tf_nndistance_g.cu.o utils/tf_ops/cd/tf_nndistance_g.cu -I /home/s/miniconda3/lib/python3.7/site-packages -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -O2
utils/tf_ops/cd/tf_nndistance_g.cu:3:10: fatal error: include/unsupported/Eigen: No such file or directory
#include "include/unsupported/Eigen"
^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [makefile:12: utils/tf_ops/cd/tf_nndistance_g.cu.o] Error 1
I have it set like this at the top of makefile: tensorflow = /home/s/miniconda3/lib/python3.7/site-packages (which is the path that shows up if I type into Terminal pip show tensorflow)
And then in tf_nndistance_g.cu I have:
#include "include/unsupported/Eigen/"
What might be the reason that this makefile isn't working? I'm using Python 3.7 on a Virtual Machine (ubuntu Virtualbox). Thanks.

Related

Errors in p4est and cmake when install dealii

Can anyone help me with this issue?
In order to use dealii, I tried to install p4est using the command
./configure && make && make install
and
cmake .. -DP4EST_DIR=/usr/local -DDEAL_II_WITH_P4EST=ON -DDEAL_II_WITH_MPI=ON -DCMAKE_INSTALL_PREFIX=/usr/local
under "build" folder, but some error occurs.
I also opened the file dealii-9.0.0/build/CMakeFiles/CMakeError.log, it says:
Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test rt_LIBRARY failed with the following output:
Change Dir: /Users/chuxiaoyun/Downloads/dealii-9.0.0/build/CMakeFiles/CMakeScratch/TryCompile-Fscvq9
Run Build Command(s):/usr/bin/make -f Makefile cmTC_bc7f9/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_bc7f9.dir/build.make CMakeFiles/cmTC_bc7f9.dir/build
Building CXX object CMakeFiles/cmTC_bc7f9.dir/src.cxx.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Drt_LIBRARY -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -mmacosx-version-min=11.6 -MD -MT CMakeFiles/cmTC_bc7f9.dir/src.cxx.o -MF CMakeFiles/cmTC_bc7f9.dir/src.cxx.o.d -o CMakeFiles/cmTC_bc7f9.dir/src.cxx.o -c /Users/chuxiaoyun/Downloads/dealii-9.0.0/build/CMakeFiles/CMakeScratch/TryCompile-Fscvq9/src.cxx
Linking CXX executable cmTC_bc7f9
/opt/homebrew/Cellar/cmake/3.25.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bc7f9.dir/link.txt --verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -mmacosx-version-min=11.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_bc7f9.dir/src.cxx.o -o cmTC_bc7f9 -lrt
ld: library not found for -lrt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [cmTC_bc7f9] Error 1
make: *** [cmTC_bc7f9/fast] Error 2
CMake Error at cmake/macros/macro_configure_feature.cmake:112 (MESSAGE):
Could not find the p4est library!
Insufficient p4est installation found!
p4est has to be configured with MPI enabled.
Please ensure that a suitable p4est library is installed on your computer.
If the library is not at a default location, either provide some hints for
autodetection,
$ P4EST_DIR="..." cmake <...>
$ cmake -DP4EST_DIR="..." <...>
or set the relevant variables by hand in ccmake.
Call Stack (most recent call first):
cmake/macros/macro_configure_feature.cmake:269 (FEATURE_ERROR_MESSAGE)
cmake/configure/configure_p4est.cmake:78 (CONFIGURE_FEATURE)
cmake/macros/macro_verbose_include.cmake:19 (INCLUDE)
CMakeLists.txt:124 (VERBOSE_INCLUDE)
I guess I haven't installed p4est correctly, so I configure it again.
# p4est-2.8 ./configure --enable-mpi.
( Here shows we are using MPI. I also tried p4est-2.8 ./configure --enable-mpi --prefix=/usr/local)
Then I tried to build and install p4est, but it gives me an error during installation:
# make
# ➜ p4est-2.8 make install
/Applications/Xcode.app/Contents/Developer/usr/bin/make install-recursive
Making install in sc
/Applications/Xcode.app/Contents/Developer/usr/bin/make install-am
build-aux/install-sh -c -d '/Users/xiaoyun/Downloads/p4est-2.8/local/lib'
/bin/sh ./libtool --mode=install /usr/bin/install -c src/libsc.la '/Users/xiaoyun/Downloads/p4est-2.8/local/lib'
libtool: install: /usr/bin/install -c src/.libs/libsc.0.dylib /Users/xiaoyun/Downloads/p4est-2.8/local/lib/libsc.0.dylib
install: /Users/xiaoyun/Downloads/p4est-2.8/local/lib/libsc.0.dylib: Permission denied
make[4]: *** [install-libLTLIBRARIES] Error 71
make[3]: *** [install-am] Error 2
make[2]: *** [install] Error 2
make[1]: *** [install-recursive] Error 1
I have no idea why the permission is denied, I also tried sudo make install:
objc[71909]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x20230f7e8) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10c9082c8). One of the two will be used. Which one is undefined.
objc[71909]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x20230f838) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10c908318). One of the two will be used. Which one is undefined.
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Operation not permitted
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Operation not permitted
make: getcwd: Operation not permitted
make: Nothing to be done for `install'.

SDL2 doesn't compile on macos Big Sur

In one of my projects I'm using git submodules to download the SDL2 Library and compile it. This is giving me a strange error so I tried to compile SDL2 Standalone and I got the same error.
I'm on a 13" MacBook Pro Big Sur
Steps to reproduce:
git clone https://github.com/libsdl-org/SDL.git
cd SDL
cmake . -Bbuild
make -C ./build
The error I get is
In file included from /Users/<user>/Documents/side side projects/neural networks/libs/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m:24:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString
- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
~~~~~~~~~~~~~~ ^ ~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro 'NS_FORMAT_ARGUMENT'
#define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
^ ~
1 error generated.
make[2]: *** [libs/SDL/CMakeFiles/SDL2.dir/src/file/cocoa/SDL_rwopsbundlesupport.m.o] Error 1
make[1]: *** [libs/SDL/CMakeFiles/SDL2.dir/all] Error 2
make: *** [all] Error 2
The message would imply that Apple's own SDK files don't compile, but that can't be right. What's even stranger is that I'm using git submodules with SDL2 in another project but that compiles successfully and I can't find any discernible difference between this and the other project.
Edit:
I user make -C ./build VERBOSE=1 to compare the output with the project that successfully compiled and the project that failed to compile.
Successfully compiled:
[ 0%] Building C object libs/SDL/CMakeFiles/SDL2.dir/src/file/cocoa/SDL_rwopsbundlesupport.m.o
cd "/Users/<user>/Documents/side side projects/Legion/build/libs/SDL" && /usr/local/opt/llvm/bin/clang -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -I"/Users/<user>/Documents/side side projects/Legion/build/libs/SDL/include" -I"/Users/<user>/Documents/side side projects/Legion/libs/SDL/include" -g -O3 -idirafter "/Users/<user>/Documents/side side projects/Legion/libs/SDL/src/video/khronos" -D_THREAD_SAFE -msse3 -msse2 -msse -m3dnow -mmmx -Wshadow -fvisibility=hidden -Wdeclaration-after-statement -Werror=declaration-after-statement -fno-strict-aliasing -Wall -fPIC -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks -o CMakeFiles/SDL2.dir/src/file/cocoa/SDL_rwopsbundlesupport.m.o -c "/Users/<user>/Documents/side side projects/Legion/libs/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m"
Take note of: -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks
Failed to compile:
[ 0%] Building C object CMakeFiles/SDL2.dir/src/file/cocoa/SDL_rwopsbundlesupport.m.o
/usr/local/opt/llvm/bin/clang -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -I/Users/<user>/Desktop/SDL-main/build/include -I/Users/<user>/Desktop/SDL-main/include -idirafter "/Users/<user>/Desktop/SDL-main/src/video/khronos" -I/usr/local/Cellar/libusb/1.0.24/include/libusb-1.0 -D_THREAD_SAFE -msse3 -msse2 -msse -m3dnow -mmmx -Wshadow -fvisibility=hidden -Wdeclaration-after-statement -Werror=declaration-after-statement -fno-strict-aliasing -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -mmacosx-version-min=11.5 -fPIC -o CMakeFiles/SDL2.dir/src/file/cocoa/SDL_rwopsbundlesupport.m.o -c /Users/<user>/Desktop/SDL-main/src/file/cocoa/SDL_rwopsbundlesupport.m
Take note of: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk
The only difference between the successfully compiled project and the project that failed to compile is the MacOS SDK version. The one that failed to compile used MacOS SDK 12 while the successful one used MacOS 11.3. Until this is fixed a temporary solution is to downgrade your MacOS SDK to 11.3.

can't MAKE tensorflow Raspberry pi examples

I installed tensorflow on the Raspberry Pi 3, running Jessie and did that in two ways, via the .whl file / pip install for Python 2.7.:
https://github.com/samjabrahams/tensorflow-on-raspberry-pi
as well as a full compile via:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/makefile
Both installs (I did them on different OS images) where successfull and went through without error.
Next, I wanted to compile the official Raspberry Pi examples from tensorflow's git repository:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/pi_examples
However, none of the examples does compile (neither the camera example nor the image recognition), both give the same error and Google doesn't tell me anything:
make -f tensorflow/contrib/pi_examples/camera/Makefile gcc --std=c++11
-O0 -I/usr/local/include -I. -I/home/pi/tensorflow/tensorflow/contrib/pi_examples/camera/../../makefile/downloads
-I/home/pi/tensorflow/tensorflow/contrib/pi_examples/camera/../../makefile/downloads/eigen/
-I/home/pi/tensorflow/tensorflow/contrib/pi_examples/camera/../../makefile/gen/proto/
-I/home/pi/tensorflow/tensorflow/contrib/pi_examples/camera/../../makefile/gen/proto_text/
-c tensorflow/contrib/pi_examples/camera/camera.cc -o /home/pi/tensorflow/tensorflow/contrib/pi_examples/camera/gen/obj/tensorflow/contrib/pi_examples/camera/camera.o
In file included from ./tensorflow/core/platform/mutex.h:31:0,
from ./tensorflow/core/framework/variant.h:31,
from ./tensorflow/core/framework/allocator.h:26,
from ./tensorflow/core/framework/tensor.h:20,
from tensorflow/contrib/pi_examples/camera/camera.cc:33:
./tensorflow/core/platform/default/mutex.h:25:22: fatal error:
nsync_cv.h: No such file or directory #include "nsync_cv.h"
^ compilation terminated. tensorflow/contrib/pi_examples/camera/Makefile:80: recipe for target
'/home/pi/tensorflow/tensorflow/contrib/pi_examples/camera/gen/obj/tensorflow/contrib/pi_examples/camera/camera.o'
failed make: ***
[/home/pi/tensorflow/tensorflow/contrib/pi_examples/camera/gen/obj/tensorflow/contrib/pi_examples/camera/camera.o]
Error 1
as well as:
make -f tensorflow/contrib/pi_examples/label_image/Makefile gcc
--std=c++11 -O0 -I/usr/local/include -I. -I/home/pi/tensorflow/tensorflow/contrib/pi_examples/label_image/../../makefile/downloads
-I/home/pi/tensorflow/tensorflow/contrib/pi_examples/label_image/../../makefile/downloads/eigen/
-I/home/pi/tensorflow/tensorflow/contrib/pi_examples/label_image/../../makefile/gen/proto/
-I/home/pi/tensorflow/tensorflow/contrib/pi_examples/label_image/../../makefile/gen/proto_text/
-c tensorflow/contrib/pi_examples/label_image/label_image.cc -o /home/pi/tensorflow/tensorflow/contrib/pi_examples/label_image/gen/obj/tensorflow/contrib/pi_examples/label_image/label_image.o
In file included from ./tensorflow/core/platform/mutex.h:31:0,
from ./tensorflow/core/framework/variant.h:31,
from ./tensorflow/core/framework/allocator.h:26,
from ./tensorflow/core/framework/tensor.h:20,
from tensorflow/contrib/pi_examples/label_image/label_image.cc:33:
./tensorflow/core/platform/default/mutex.h:25:22: fatal error:
nsync_cv.h: No such file or directory #include "nsync_cv.h"
^ compilation terminated. tensorflow/contrib/pi_examples/label_image/Makefile:79: recipe for
target
'/home/pi/tensorflow/tensorflow/contrib/pi_examples/label_image/gen/obj/tensorflow/contrib/pi_examples/label_image/label_image.o'
failed make: ***
[/home/pi/tensorflow/tensorflow/contrib/pi_examples/label_image/gen/obj/tensorflow/contrib/pi_examples/label_image/label_image.o]
Error 1
How can I locate / add / compile "nsync_cv.h"?
And btw:
export HOST_NSYNC_LIB=`tensorflow/contrib/makefile/compile_nsync.sh`
gives me:
g++ -M -std=c++11 -DNSYNC_USE_CPP11_TIMEPOINT -DNSYNC_ATOMIC_CPP11
-I../../platform/c++11 -I../../platform/gcc -I../../platform/posix -pthread -I../../public -I../../internal ../../internal/*.c ../../testing/*.c ../../platform/c++11/src/nsync_semaphore_mutex.cc
../../platform/c++11/src/per_thread_waiter.cc
../../platform/c++11/src/yield.cc
../../platform/c++11/src/time_rep_timespec.cc
../../platform/c++11/src/nsync_panic.cc \
../../platform/c++11/src/start_thread.cc > dependfile make: 'nsync.a' is up to date.
I once compiled tensorflow with the makefile on a nvidia Jetson TX1 and I could compile and run the examples by adding some lines to the Makefiles of the examples:
after line 18:
NSYNCLIBDIR := $(TFMAKEFILE_DIR)/downloads/nsync/builds/default.linux.c++11 !!!change folder default.linux.c++11 to where your libnsync.a is!!!
NSYNCLIBS := $(NSYNCLIBDIR)/libnsync.a
after line 26:
NSYNC := $(TFMAKEFILE_DIR)/downloads/nsync/public/
after line 36:
-L$(NSYNCLIBDIR) \
after line 43:
-I$(NSYNC) \
after line 51:
-lnsync \
change line 72 to:
$(EXECUTABLE_NAME): $(EXECUTABLE_OBJS) $(TFLIBS) $(NSYNCLIBS)
Hope it works with that changes, good luck :)

gfortran cannot read its own creation

I am trying to compile a code with gfortran. One of the first things that happens in the compilation is the creation of constants.mod. Soon after that gfortran tells me:
Fatal Error: Cannot read module file ‘constants.mod’ opened at (1), because it was created by a different version of GNU Fortran
Now here's the thing: This module file is created by the same gfortran that it's trying to read it. gfortran creates the thing itself and then 1 second later thinks the file was created by some other version! Any idea what's going on here?
You'll probably want to see the compile command:
mpif90 -c -O3 -ISDF/FORTRAN/include -I/usr/include -Iobj -Jobj -o obj/shared_data.o src/core/shared_data.F90
shared_data.F90 contains the module constants at the top of the file.
EDIT: Here's the compile command followed by the full error message:
$> mpif90 -c -O3 -ISDF/FORTRAN/include -I/usr/include -Iobj -Jobj -o obj/shared_data.o src/core/shared_data.F90
src/core/shared_data.F90:67:6:
USE constants
1
Fatal Error: Cannot read module file ‘constants.mod’ opened at (1), because it was created by a different version of GNU Fortran
compilation terminated.
UPDATE: I hope you'll agree this is weird. The file that is failing is in src/core. If I cd to src/core and issue this command:
mpif90 -c -O3 -I../../SDF/FORTRAN/include -I../../obj -J../../obj -o ../../obj/shared_data.o shared_data.F90
it compiles just fine! But then I clean everything out of the obj directory and I cd two levels up and issue:
mpif90 -c -O3 -ISDF/FORTRAN/include -Iobj -Jobj -o shared_data.o src/core/shared_data.F90
and it fails with the error I showed above! What is the difference??? Thanks.

fortran 90 gfortran fatal error can't rename module file exists

I'm trying to compile and run a fortran 90 code with gfortran on a windows 7 machine.
When I compile and link using
gfortran -I"myDir" -g -Wall -Wextra -pedantic -fimplicit-none -fbacktrace -fcheck=all -Wuninitialized
-Q -J"bin" parametricStudy.f90 -o LDCP
I get the following error:
Fatal Error: Can't rename module file 'bin/initializeubcs_mod.mod0' to 'bin/init
ializeubcs_mod.mod': File exists
If I delete the mod file in the folder 'bin', then it compiles without any problems, but I don't want to have to delete all of my .mod files in the folder every time I compile my code. What should I do?
Any help is greatly appreciated!
If you're using gfortran 4.9 or 4.9.1 I guess you're being bit by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62215 . In that case, please update to 4.9.2 where this issue is fixed.