I tried everything I could think of already to fix it but after several Hours I just give up. I want to compile a Lib with qmake to include a parse for csv files. Sadly when I use mingw32-make I get this Error:
C:\Users\Deto24\Downloads\qtcsv-1.5\build>qmake ..\qtcsv.pro CONFIG+=[release] DESTDIR=%cd%
Info: creating stash file C:\Users\Deto24\Downloads\qtcsv-1.5\build\.qmake.stash
Project MESSAGE: === Configuration of qtcsv ===
Project MESSAGE: Qt version: 6.0.2
Project MESSAGE: Library version: 1.5.0
Project MESSAGE: Library files will be created in folder: C:/Users/Deto24/Downloads/qtcsv-1.5/build
Project MESSAGE: === Configuration of qtcsv ===
Project MESSAGE: Qt version: 6.0.2
Project MESSAGE: Library version: 1.5.0
Project MESSAGE: Library files will be created in folder: C:/Users/Deto24/Downloads/qtcsv-1.5/build
Project MESSAGE: === Configuration of qtcsv ===
Project MESSAGE: Qt version: 6.0.2
Project MESSAGE: Library version: 1.5.0
Project MESSAGE: Library files will be created in folder: C:/Users/Deto24/Downloads/qtcsv-1.5/build
C:\Users\Deto24\Downloads\qtcsv-1.5\build>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'C:/Users/Deto24/Downloads/qtcsv-1.5/build'
g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++1z -Wall -Wextra -Wextra -Werror -Wformat=2 -Wuninitialized -Winit-self -Wswitch-enum -Wundef -Wpointer-arith -Wdisabled-optimization -Wcast-align -Wcast-qual -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQTCSV_LIBRARY -DQT_NO_DEBUG -DQT_CORE_LIB -I../../qtcsv-1.5 -I. -I../include -IC:/Qt/6.0.2/mingw81_64/include -IC:/Qt/6.0.2/mingw81_64/include/QtCore -Irelease -IC:/Qt/6.0.2/mingw81_64/mkspecs/win32-g++ -o release\writer.o ..\sources\writer.cpp
In file included from ..\sources\writer.cpp:1:
../../qtcsv-1.5/include/qtcsv/writer.h:6:10: fatal error: QTextCodec: No such file or directory
#include <QTextCodec>
^~~~~~~~~~~~
compilation terminated.
mingw32-make[1]: *** [Makefile.Release:248: release/writer.o] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/Deto24/Downloads/qtcsv-1.5/build'
mingw32-make: *** [Makefile:45: release] Error 2
I'm fairly new to adding Lib's to QT and while there seems no real explains for how to compile those lib's step by step I could gather some Informations by myself. I created the PATH as you can see on the Picture, so I hope that is alright.
Any Ideas what I did wrong?
I am working in building Japanese NLP sentiment analysis, to tokenise the Japanese sentence we have a package called "SudachiPy".I tried to install it but I am getting error while installing the package. I'm using anaconda in MAC Book pro.
I tried all the steps mentioned in stack overflow by installing following libraries to debug the error.
pip3 install python3-dev
Also I tried launching an "Ubuntu" instance from AWS and try to install "SudachiPy" but still encountering the same error.
pip3 install SudachiPy
Building wheels for collected packages: dartsclone
Building wheel for dartsclone (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lf/4754h1x94x39xfw_q6c8_ryc0000gn/T/pip-install-st3sqcmm/dartsclone/setup.py'"'"'; __file__='"'"'/private/var/folders/lf/4754h1x94x39xfw_q6c8_ryc0000gn/T/pip-install-st3sqcmm/dartsclone/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/lf/4754h1x94x39xfw_q6c8_ryc0000gn/T/pip-wheel-x8k1ryul --python-tag cp36
cwd: /private/var/folders/lf/4754h1x94x39xfw_q6c8_ryc0000gn/T/pip-install-st3sqcmm/dartsclone/
Complete output (25 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
creating build/lib.macosx-10.7-x86_64-3.6/dartsclone
copying dartsclone/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/dartsclone
running build_ext
cythoning dartsclone/_dartsclone.pyx to dartsclone/_dartsclone.cpp
/anaconda3/lib/python3.6/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /private/var/folders/lf/4754h1x94x39xfw_q6c8_ryc0000gn/T/pip-install-st3sqcmm/dartsclone/dartsclone/_dartsclone.pxd
tree = Parsing.p_module(s, pxd, full_module_name)
warning: dartsclone/_dartsclone.pyx:119:49: local variable 'result' referenced before assignment
warning: dartsclone/_dartsclone.pyx:120:15: local variable 'result' referenced before assignment
building 'dartsclone._dartsclone' extension
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/dartsclone
creating build/temp.macosx-10.7-x86_64-3.6/csrc
creating build/temp.macosx-10.7-x86_64-3.6/csrc/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I./csrc/include -I/anaconda3/include/python3.6m -c dartsclone/_dartsclone.cpp -o build/temp.macosx-10.7-x86_64-3.6/dartsclone/_dartsclone.o
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
dartsclone/_dartsclone.cpp:610:10: fatal error: 'ios' file not found
#include "ios"
^~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for dartsclone
You need to install some deps before, similar to Linux build-essential:
xcode-select install
Also, you may need to specify the right compiler, by setting this env. variable:
CFLAGS='-stdlib=libc++'
I've tried to solve this using the previous questions/answers on SO but without any success. So, here's my problem.
I'm using RStudio on and Ubuntu box (14.04) and I tried to upgrade rJava from sources and in the process I managed to lose it.
I tried to install it again using,
install.packages("rJava")
which returned the following error message,
configure: error: One or more Java configuration variables are not set.
Make sure R is configured with full Java support (including JDK). Run
R CMD javareconf
as root to add Java support to R.
If you don't have root privileges, run
R CMD javareconf -e
to set all Java-related variables and then install rJava.
ERROR: configuration failed for package ‘rJava’
* removing ‘/home/darren/R/x86_64-pc-linux-gnu-library/3.2/rJava’
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
So, I went to the terminal and typed,
sudo R CMD javareconf
which also gave the following error,
trying to compile and link a JNI program
detected JNI cpp flags :
detected JNI linker flags : -L/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server -ljvm
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c conftest.c -o conftest.o
conftest.c:1:17: fatal error: jni.h: No such file or directory
#include <jni.h>
^
compilation terminated.
make: *** [conftest.o] Error 1
Unable to compile a JNI program
JAVA_HOME : /usr/lib/jvm/default-java
Java library path:
JNI cpp flags :
JNI linker flags :
Updating Java configuration in /usr/lib/R
Done.
I tried to follow these links, one and two but they didn't seem to resolve my issue; there are more links on SO but I'm not sure which one to follow. I've also un-installed and re-installed RStudio via the Ubuntu Software Centre but this didn't make any difference.
Can anyone else help?
In short, I want to be able to use RStudio with rJava again without it destroying any other uses of Java (such as jmol).
You don't seem to have JDK installed. You will need at least
sudo apt-get install openjdk-7-jdk
then re-run
sudo R CMD javareconf
Make sure you do NOT set JAVA_HOME by hand - it will be detected automatically. You should then see something like this:
$ sudo R CMD javareconf
Java interpreter : /usr/bin/java
Java version : 1.7.0_91
Java home path : /usr/lib/jvm/java-7-openjdk-amd64/jre
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
trying to compile and link a JNI program
detected JNI cpp flags : -I$(JAVA_HOME)/../include
detected JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/lib/jvm/java-7-openjdk-amd64/jre/../include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c conftest.c -o conftest.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o conftest.so conftest.o -L/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server -ljvm -L/usr/lib/R/lib -lR
JAVA_HOME : /usr/lib/jvm/java-7-openjdk-amd64/jre
Java library path: $(JAVA_HOME)/lib/amd64/server
JNI cpp flags : -I$(JAVA_HOME)/../include
JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
What is wrong with sudo apt-get install r-cran-rjava ?
See for example this earlier answer and the question / thread around it.
For an installation from scratch, you could still much worse than starting from sudo apt-get build-dep r-cran-rjava. It will get you the JDK corresponding to your Ubuntu version.
First i would recommend installing Rstudio from its website: https://www.rstudio.com/products/rstudio/download/ (i.e. Rstudio 64bit: https://download1.rstudio.org/rstudio-0.99.489-amd64.deb). This does not solve the problem directly, but it helps to avoid other bugs with Rstudio.
Regarding the error, trying to make sure you have JDK install. I don't think the command java -version can tell if JDK is installed. You have to check the package of JDK itself, or based on the error message, do this:
locate jni.h
The output should match or compatible with your JAVAHOME, e.g:
/usr/lib/jvm/java-7-openjdk-amd64/include/jni.h
/usr/lib/jvm/java-7-oracle/include/jni.h
Update 1:
R CMD javareconf is looking for the jni.h file under $(JAVA_HOME)/include
You have JDK installed, but it is very likely that you are having default java to a JRE directory, that why the error happened.
You can see where default-java is really pointing to by doing this command:
jRealDir=$(readlink -f /usr/lib/jvm/default-java)
echo $jRealDir
# sample correct output: /usr/lib/jvm/jdk1.8.0_65
# or /usr/lib/jvm/java-8-oracle if you default to Oracle's
# now check jni.h
ls -l $jRealDir/include/jni.h
# sample expected output:
# /usr/lib/jvm/jdk1.8.0_65/include/jni.h
If the ls command failed, you have to setup so that javareconf ( and later rJava) can use the java from JDK not from JRE. You have two options:
Method 1: Do it system-wide
This is convenient, but may effect other program like the one you mentioned jmol. But don't worry, this is revertible, just re-run the command and pick the old one. Do the following command and pick the dir that has JDK:
sudo update-alternatives --config java
After that test how jmol works, if it works alright then congrat. You are now ready to test rJava. If not, try the second method below
Method 2: Do it for R only
put this in the .Rprofile under your home directory
Sys.setenv(JAVA_HOME = '/usr/lib/jvm/jdk1.8.0_65')
# this set JAVA_HOME for R to correct java home dir.
After updating or creating the .Rprofile DO restart R in Rstudio. The R CMD javareconf may still fail in this case, but it should be OK if you run it from Shell under Tools menu of Rstudio.
Regarding the installing or Rstudio from Ubuntu's stock repo. It would not make a difference for getting rJava running. Then again, I recommend installing Rstudio for its homepage because new version also has some nice features (i.e. better autocompletion, which I like the most).
Here is link on R-Bloggers that worked for me: https://www.r-bloggers.com/installing-rjava-on-ubuntu/
sudo apt-get install -y default-jre
sudo apt-get install -y default-jdk
sudo R CMD javareconf
install.packages("rJava")
I've been dealing with this exact issue, nothing in this thread or other that are similar have solved it. I'm on Ubuntu 16.04, here's how I got it to work:
apt-get install openjdk-9-jdk
rm -rf /usr/lib/jvm/default-java
ln -s /usr/lib/jvm/java-9-openjdk-amd64/ /usr/lib/jvm/default-java
You can see where the JAVA_HOME is in the error message.
Then use locate jni.h to find where is jni.h, next use soft link to link this location to $(JAVA_HOME)/include, just like #biocyberman mentioned.
This is what I did:
ln -s /usr/lib/jvm/java-8-openjdk-amd64/include/jni.h /opt/conda/include/jni.h
ln -s /usr/lib/jvm/java-8-openjdk-amd64/include/linux/jni_md.h /opt/conda/include/jni_md.h
ln -s /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so /usr/lib/
Since my JAVA_HOME is /opt/conda and I also don't have jni_md.h and -ljvm.
I am use Ubuntu 16.04.
I asked this question on the Qt forums, but they seem to be pretty quiet these days.
I'm running the relatively new Qt Creator 2.6.2 (with Qt 5.0.1). When I try to build the debugger helper, I get the following error:
Building helper(s) with toolchain 'GCC (x86 64bit)'... Building helper
'GDB helper' in
/Developer/Applications/Qt/5.0.1/clang_64//qtc-debugging-helper/
Running /Developer/Applications/Qt/5.0.1/clang_64/bin/qmake -spec
macx-clang dumper.pro -nocache CONFIG+=x86_64 ...
Running /usr/bin/make all -k ... Error running '/usr/bin/make all -k'
in /Developer/Applications/Qt/5.0.1/clang_64//qtc-debugging-helper/:
The process returned exit code 2: clang++ -c -pipe
-mmacosx-version-min=10.6 -O2 -Wall -W -fPIC -DUSE_QT_CORE=1 -DUSE_QT_GUI=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../mkspecs/macx-clang -I. -I../include -I../include/QtWidgets -I../lib/QtWidgets.framework/Versions/5/Headers -I../include/QtGui -I../lib/QtGui.framework/Versions/5/Headers -I../include/QtCore -I../lib/QtCore.framework/Versions/5/Headers -I. -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/System/Library/Frameworks/AGL.framework/Headers -o dumper.o dumper.cpp make: clang++: No such file or directory make: *
[dumper.o] Error 1 make: Target `all' not remade because of errors.
Build failed.
So, I see that it's looking for a file called "clang++" which I evidently don't have. Can someone explain to me what the workaround for this is? I'm accustomed to just using the pre-built install packages for Qt.
Thanks.
You need to install command line tools package for Xcode which includes 'clang++' compiler.
You can find them here under Looking for additional developer tools? link.
I am trying to install mySQL for Python on PPC ibook G4 running Leopard. I have Python 2.7.2, XCODE 3.1.3 and MAMP 1.9.6 installed.
I was trying both MySQL-Python-1.2.2 and MySQL-Python-1.2.3, but I am always getting this error:
andreass-ibook-g4:MySQL-python-1.2.3 aed0101$ sudo python setup.py buildrunning build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.7/MySQLdb
running build_ext
building '_mysql' extension
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -isysroot/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/Applications/MAMP/Library/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.3-fat-2.7/_mysql.o -fno-omit-frame-pointer -g
_mysql.c:36:23: error: my_config.h: No such file or directory
_mysql.c:38:19: error: mysql.h: No such file or directory
_mysql.c:39:26: error: mysqld_error.h: No such file or directory
...more errors
lipo: can't figure out the architecture type of: /var/tmp//ccM5WtnK.out
error: command 'gcc-4.0' failed with exit status 1
Can anybody help me with this?
Thanks.
It looks like the MySQL development headers are not found. If running mysql_config from the shell gives an error, that's probably why. Make sure mysql_config is on your path or else edit site.cfg and set the correct path in there. Normally setup.py will bail out if mysql_config exits with an error, so it's not clear what happened here.