Recently, I set a environmental variable in the .cshrc file in CentOS 6.6 system, with the command setenv CXX g++-4.8.5/bin/g++. Afterwards, I don't want to this CXX being set any more. So I comment out this line. However, when I launch a new terminal (right click and select Konsole in the main screen), this CXX still is set to g++-4.8.5/bin/g++.
Does anyone know what's going there?
Thank you.
Related
I'm running into PATH difficulty setting up a new React Native iOS project in Xcode 7.1. I'm trying to use ndenv to manage node versions, which means ~/.ndenv/shims needs to be on PATH. To that end, I have PATH set as a user-defined project setting as $PATH:~/.ndenv/shims. The Xcode settings UI shows the correct expanded PATH value.
Yet the project, generated by react-native init, still fails to build. The custom build script fails to find react-native:
../node_modules/react-native/packager/react-native-xcode.sh: line 36: react-native: command not found
react-native is installed correctly, but the environment variables dump in the build output makes clear that ~/.ndenv/shims isn't on PATH. My PATH settings don't appear in the build environment. However, if I set a random user-defined setting (e.g. FOOBAR=baz), that does correctly show up in the build environment.
That result plus further inspection of PATH in the build environment makes clear that Xcode is overriding PATH somewhere along the line.
So in order of preference:
How do I correctly append to PATH for a custom build script in Xcode 7?
Alternatively, what's the best (least hacky?) way of getting ndenv-managed npm modules on PATH for the build script?
Modifying react-native-xcode.sh is out of the question, since that's a part of the external react-native npm module.
UPDATE 1
As a temporary workaround, I've bailed on ndenv and installed node via homebrew. This puts react-native on the (apparently-hardcoded) Xcode path at /usr/local/bin, and works to get the build running. I'm not going to submit or accept this as a solution, since it doesn't allow the repeatable control of node versions that ndenv does.
The problem seems to be that the react-native-xcode.sh script depends on the react-native-cli package to be in PATH. This issue was reported to the project in these two issues on Github:
https://github.com/facebook/react-native/issues/3974
https://github.com/facebook/react-native/issues/3948
I expect a fix to be implemented quite soon, because this is a major problem for anyone using the react-native cli to create new projects.
There are a few work arounds for this problem, but none of them are perfect. Which one would work for you depends on your node / npm setup:
I myself installed node via nvm and just needed to add export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.shbefore running the react-native-xcode.sh.
For this to work you need to have react-native-cli installed globally.
If you need help finding a solution for your specific setup, please give me some more information about your node setup. ( or you can try one of the other solutions pointed out in the issues I linked above. )
Had the same issue. The work around called out in the link below is working for me. Haven't found a permanent solution.
The XCode $PATH differs from terminal $PATH and it doesn't include path of nvm nodes (~/.nvm/versions/...). This can be temporarily fixed by adding source ~/.bash_profile to the beginig of react-native-xcode.sh
https://github.com/facebook/react-native/issues/3948
This issue was effectively fixed when facebook/react-native#5518 landed. react-native-xcode.sh now respects a NODE_BINARY environment variable that tells it where to find node on the build system. Under your app's target, see Build Phases > Bundle React Native code and images and set the shell script code to:
export NODE_BINARY=$HOME/.ndenv/shims/node
../node_modules/react-native/packager/react-native-xcode.sh
If your node is in a different location, change the value of NODE_BINARY to suit your installation. Here's a screencap from Xcode 7.1 to aid navigation:
It looks like a fix for this was just published as release 0.14.2
https://github.com/facebook/react-native/releases/tag/v0.14.2
I'm trying to build AllJoyn for IOS using Xcode (5.1.1) on OSX Mavericks (10.9.3). I have followed all the steps posted here to the letter but keep getting a "Shell script invocation error", error: can't exec 'scons' (No such file or directory) on the last step in the instructions and cannot figure out how to resolve it, I have installed scons with homebrew and tried donloading and installing it manually but for some reason it can't find it. Any help would be much appreciated.
I found a solution. Brady's comment was right, Xcode could not find scons.
In order to fix it, I changed the field for "Build Tool" under Target -> info, it originally had only "scons" as its value so I did a search for it in a terminal (which scons), and put the full path in the setting (in my case "/usr/local/bin/scons").
In addition to this issue, I had an issue with openssl not being found even after executing the command launchctl setenv OPENSSL_ROOT <path to top level folder of openssl> so under Build Settings I added a user-defined setting with the key "OPENSSL_ROOT" with the value of the full path to the openssl top level folder.
I'm probably missing something really obvious, but I don't have the Environmental Variables dialog shown in Configuring environmental variables. I've been through Settings -> Environment... (and other submenus from Settings) and its just missing.
OpenSSL FIPS Capable is particular about having CC and FIPSLD_CC set to embed the module's fingerprint. I even tried running the following as a prebuild step with no joy (the echo's are empty):
Running project pre-build steps
export CC=`find /usr/local/ssl -name fipsld`
export FIPSLD_CC=`find /usr/bin -name g++`
echo $CC
echo $FIPSLD_CC
I'm working on Debian 7.3 (x64) fully patched, if it matters. Code::Blocks was installed from Debian's repos. OpenSSL was custom built and installed in /usr/local/ssl.
Where does one set environmental variables in Code::Blocks 10.05?
The Environment Variables Editor is an optional plugin. Debian packages can be found at Package: codeblocks-contrib (10.05-2.1).
To install it you need to install package codeblocks-contrib as well as codeblocks:
sudo apt-get install codeblocks codeblocks-contrib
Close and restart Code::Blocks, if it is running. The dialog you looking for will then appear in Settings -> Environment
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
can anyone help me compile Haartraining? I need to use the createsamples utility.
I am running OSX Lion and OpenCV 2.4. I tried to use this makefile but it gives me some linker errors http://code.google.com/p/tutorial-haartraining/source/browse/trunk/HaarTraining/src/Makefile?r=76
steps to compile and run c++ opencv 2.4.4 on mac os x lion 10.7.5 with cmake 2.8.10 and xcode 4.6.1
Having the right tools
download opencv-unix from http://sourceforge.net/projects/opencvlibrary/files/ and untar it wherever
download cmake .dmg from http://www.cmake.org/cmake/resources/software.html and install it
i am assuming you have xcode 4.6 on os x lion which includes the ios sdk 6.1
go to xcode preferences to download and install the Command Line Tools so you have g++ etc.
Use cmake to compile opencv
go to the extracted opencv folder
create a build directory
mkdir build
cd build
cmake -D WITH_TBB=OFF -D BUILD_NEW_PYTHON_SUPPORT=OFF -D BUILD_FAT_JAVA_LIB=OFF -D BUILD_TBB=OFF -D BUILD_EXAMPLES=ON -D CMAKE_CXX_COMPILER=g++ CMAKE_CC_COMPILER=gcc -D CMAKE_OSX_ARCHITECTURES=x86_64 -D BUILD_opencv_java=OFF -G "Unix Makefiles" ..
make -j8
sudo make install
from the build folder, go to bin/ and run one of the tests
./opencv_test_stitching
Create your own c++ opencv xcode project
fire up xcode and create a new xcode project
select Command Line Tool for the type of project under os x
open your project's build settings
under Architectures, set Architecture to 64-bit intel. also set Valid Architectures to x86_64
under Build Options, set Compiler for C/C++ to Default Compiler
under Search Paths, set Header Search Paths to /usr/local/include
also under Search Paths, set Library Search Paths to /usr/local/lib
under Apple LLVM compiler 4.2 - Language set C++ Standard Library to libstd++
Add the compiled opencv libraries to your project
go the the Build Phases tab next to Build Settings tab you were in
inside Link Binary With Libraries, click on the + sign and choose Add Other
hit the front slash / on your keyboard and enter /usr/local/lib
hit enter and select the libraries you want to use in your project
make sure you always select libopencv_core.2.4.4.dylib
hit enter and you will see the selected dylibs under your project
write some code
first lets organize the files, right click on your project blueprint icon and select New Group
name the new group opencv or whatever
drag the dylibs and drop them in that group
open main.cpp
copy code from any of the sample tests that came with opencv and paste it here
make sure all the required dylibs are added, for example, if you copied the opencv_test_stitching.cpp code into main.cpp, you will need to add the following libraries in the previous steps
libopencv_core.2.4.4.dylib
libopencv_highgui.2.4.4.dylib
libopencv_stitching.2.4.4.dylib
Cheers.
Compilation under Lion is surprisingly simple.
download the source tarball from here
uncompress the downloaded package
create somewhere the build directory, for example in the same folder where you have uncompressed source
from this newly created folder issue cmake -i ../uncompressed_opencv_folder_name
Configure OpenCV according to your needs, don't forget to make OpenCV libraries static (at least it didn't work for me otherwise)
Variable Name: BUILD_SHARED_LIBS
Description: Build shared libraries (.dll/.so) instead of static ones (.lib/.a)
Current Value: OFF
Run make -j4
install compiled binaries with make install
In the OpenCV installation directory you will find required files, within bin subfolder
I am trying to build Erlang on Solaris 10. The build process fails with the message that it can not find libncurses.so.5.
I have installed libncurses from sunfreeware.com, which I have build from scratch and has installed itself in /usr/local/lib/.
I have tried to set LDFLAGS with -L/usr/local/lib/ but have still had no luck.
What am I missing so that make picks up the library?
I am using GNU Make 3.81 and GCC 3.4.6.
Could you post the relevant bit from config.log?
Did you also set the include path with -I in either CPPFLAGS or CFLAGS?
Update: You could also try installing Erlang from OpenCSW instead.