Error compiling Fortran code with eclipse... it is OK when using Gfortran via Linux terminal - linux

I am trying to compile a .f Fortran code with Eclipse. I have tried both of the below methods from the Eclipse help site:
Starting a Project with an Auto-Generated Makefile
Starting a Project with a Hand-Written Makefile
However, Eclipse gives multiple different errors... Here are some of the errors:
DIMENSION DDDJ(0:IG,-1:JG)
1
Error: Non-numeric character in statement label at (1)
../Main1.f:16.5:
DIMENSION DDDJ(0:IG,-1:JG)
1
Error: Unclassifiable statement at (1)
../Main1.f:19.5:
DIMENSION MSN(1:NPP) ! S(x,t)
1
Error: Non-numeric character in statement label at (1)
Fatal Error: Error count reached limit of 25.
make: *** [Main1.o] Error 1
14:51:55 Build Finished (took 1s.244ms)
I have compiled the code in the terminal using Gfortran simply and i have obtained the executable file an obtained the results. But Eclipse did not work for me at all.
I want to debug my code. it is 1236 raws. Can someone help me with Eclipse or any other suggestion?

It is related with the form of Fortran file. I was copying the code into a new Fortran source file. I decided to import the file that I have into the project.

Related

Ant LibusbJava compile error: "jni.h: No such file"...fixed, now a memset error

There appears to be a Ant / jni.h problem (for my setup) with LibusbJava. I get the following error when setting up LibusbJava by running
ant linux
in CentOS 6.3 as root (quick and dirty test, thanks for those concerned about user level =0). I will redo with proper restrictions as shown on a libusbjava reference after reflection when first install works. LibusbJava, is a Java wrapper for the libusb library.
The output starts out like this:
[root#somebox LibusbJava]# ant linux -lib $JAVA_HOME/include -lib $JAVA_HOME/include/linux
Buildfile: build.xml
clean:
Build LibusbJava Test Linux:
Build LibusbJava Test:
[echo] Building Library for unit tests:
[exec] /.../libusbjava/trunk/LibusbJava/LibusbJava.cpp:27:17: error: jni.h: No such file or directory
[exec] /.../libusbjava/trunk/LibusbJava/LibusbJava.cpp:34:26: error: test/CuTest.h: No such file or directory
`...`
as it was not set on my system. It appears that jni.h is a header called by C++ code, which I had to add to the LibusbJava.cpp file. This is the new include, /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/include/jni.h. I then get an error with jni.h not being able to fine jni_md.h which is an include in jni.h #include "jni_md.h".
Clearly this is not the right approach, so perhaps I need a correct Ant reference, but I cannot seem to do it with a -lib switch. Besides, this just creates thousands of jni.h file errors during the Ant build attempt.
How can I fix this problem?
Notes: I've set$JAVA_HOME up like JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64 and javac and java work fine.
New discovery... after helpful questions which guided me, I am much closer to successful compilation.
When I install LibusbJava and manually install all the library references in build.xml there is still an error compiling the LibusbJava based on a memset error. I see memset patches for libusb that appeared in 2007 and it's unclear how to use or if they relate. Investigating... Hints, comments and questions welcome. My most sincere thanks for the help thus far.
[exec] /.../libu/libusbjava/trunk/LibusbJava/objects/Usb_Device.cpp: In function ‘void Usb_Device_disconnect(JNIEnv*)’:
[exec] /.../libu/libusbjava/trunk/LibusbJava/objects/Usb_Device.cpp:88: error: ‘memset’ was not declared in this scope
[antcall] Exiting /.../libu/libusbjava/trunk/LibusbJava/build.xml.
BUILD FAILED
but I find no referece to an include string.h or cstring. The header of Usb_Device.cpp mentions it is a C++ Stub for the java class of a java class ch.ntb.inf.libusbJava.Usb_Device. which only has this include #include "Usb_Device.h" which also does not appear to have a string include. Perhaps just insertion of#include`?

using mupdf ndk-build error

I am trying to use mupdf in android application.I am using windows 7 and cygwin terminal.I used make but it gave error and
make NOX11=yes
execute successfully.
then i used ndk-build and it gives this error.
SharedLibrary : libmupdf.so
c:/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libmupdfcore.a(pdf_fontfile.o)(.text.pdf_lookup_builtin_font+0x18): unresolvable R_ARM_THM_CALL relocation against symbol `strcmp'
c:/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
/cygdrive/c/android-ndk-r8b/build/core/build-binary.mk:378: recipe for target `obj/local/armeabi/libmupdf.so' failed
make: *** [obj/local/armeabi/libmupdf.so] Error 1
please help me.I am new to android ndk.
Thank you.
This seems like a known issue. Try adding the line:
NDK_TOOLCHAIN_VERSION=4.4.3
to the file ..\android\jin\Application.mk. That will at least get rid of this particular error.
EDIT: Look here http://code.google.com/p/android/issues/detail?id=35393 for more information
UPDATE:
mupdf world is a murky one. Even the version of NDK vis-a-vis the version of mupdf (http://mupdf.com/download/archive/) you use will determine what sort of errors or warnings you get. From my experience, mupdf-0.9 (+mupdf-thirdparty-2011-02-24.zip) behaves well with android-ndk-r6b, while mupdf-1.1 (+mupdf-thirdparty-2012-08-14.zip) will behave just fine with android-ndk-r8b.

CMake finds the correct library, but VC++ attempts to link with something else

I have a CMake module to locate FreeGLUT:
FIND_PATH(FREEGLUT_INCLUDE_DIR NAMES GL/freeglut.h)
FIND_LIBRARY(FREEGLUT_LIBRARY NAMES freeglut freeglut_static)
SET(FREEGLUT_LIBRARIES ${FREEGLUT_LIBRARY})
SET(FREEGLUT_INCLUDE_DIRS ${FREEGLUT_INCLUDE_DIR})
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FreeGLUT DEFAULT_MSG FREEGLUT_LIBRARY FREEGLUT_INCLUDE_DIR)
MARK_AS_ADVANCED(FREEGLUT_INCLUDE_DIR FREEGLUT_LIBRARY)
It works fine and locates freeglut_static.lib when I generate NMake Makefiles on Windows. I'm attempting to statically link FreeGLUT into my DLL:
FIND_PACKAGE(FreeGLUT REQUIRED)
ADD_LIBRARY(vti SHARED ${VTI_SOURCES})
ADD_DEFINITIONS("-DBUILD_VTI=1 -DFREEGLUT_STATIC=1")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${FREEGLUT_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(vti ${FREEGLUT_LIBRARIES})
My source code builds correctly, but when it gets to the linking stage, VC++ fails with:
LINK : fatal error LNK1104: cannot open file 'freeglut.lib'
Which is strange since freeglut.lib isn't mentioned anywhere that I can see in the generated NMake makefiles. It should be trying to link with freeglut_static.lib, which CMake locates and sets in FREEGLUT_LIBRARIES.
What might be causing this?
This is caused with pragma directives in FreeGLUT code (see freeglut_std.h). Using FREEGLUT_STATIC should really fix that for you, but I think you should pass it to CMake without quotes: ADD_DEFINITIONS(-DBUILD_VTI -DFREEGLUT_STATIC)

getting error on executing a program LNK1104

i am using GLUT 3.7.6 with VC++6.0 n on compiling a program i get following error
--------------------Configuration: abc2 - Win32 Debug--------------------
Linking...
LINK : fatal error LNK1104: cannot open file "abc2.exe"
Error executing link.exe.
abc2.exe - 1 error(s), 0 warning(s)
i have included all the header files ...linked all the lib files bt still the result is same...!!...please guide me through this problem...THNX in advance...!!
This usually happens when the output file already exists and something has a lock on it. Check to see if abc2.exe is alright running, or of some program has a file lock on it.
You can check whether abc.exe is running using Process Explorer from sysinternals. If that's the case the link step will fail.
Also check the target file is not write-protected.
All the Microsoft tool error codes are documented online - see here for more reasons why you might see LNK1104.

Compiling pjsip for iOS 4.0

I've been having issues with compiling pjsip for iOS 4.0.
I am using the latest trunk version from SVN and keep getting a portaudio error. When using the piedmontwireless guide: http://www.piemontewireless.net/PJSip155_and_iPhoneSDK312 I get a missing separator error in my build.mak file, which would indicate a whitespace/tabbing error, but for the life of me I cannot find it.
According to the pjsip mailing lists, you should be able to compile out of the box for iOS 4.0, but I get this error:
../src/pjmedia-audiodev/errno.c:23:26: error: portaudio.h: No such file or directory
../src/pjmedia-audiodev/errno.c: In function ‘pjmedia_audiodev_strerror’:
../src/pjmedia-audiodev/errno.c:104: warning: implicit declaration of function ‘Pa_GetErrorText’
make[2]: *** [output/pjmedia-audiodev-arm-apple-darwin9/errno.o] Error 1
make[1]: *** [pjmedia-audiodev] Error 2
I'll keep punching through this but any help would be really appreciated.
EDIT: I do have portaudio.h
The specific step you are missing is to have a config_site.h file in the proper location.
pjlib/include/pj/config_site.h
It needs to contain the following:
#define PJ_CONFIG_IPHONE 1
#include <pj/config_site_sample.h>
So the configuration will avoid libraries that are not needed or won't compile for the arm chip in the iPhone.
After this addition start over with:
./configure-iphone
and then
make dep && make clean && make
./configure-iphone
Fresh from SVN
Configurations for current target have been written to 'build.mak', and 'os-auto.mak' in various build directories, and pjlib/include/pj/compat/os_auto.h.
Further customizations can be put in:
- 'user.mak'
- 'pjlib/include/pj/config_site.h'
The next step now is to run 'make dep' and 'make'.
Done configuring for iPhoneOS4.2.sdk
Shouldn't ./configure-iphone setup pjlib/include/pj/config_site.h
As
#define PJ_CONFIG_IPHONE 1
#include <pj/config_site_sample.h>
Thanks for the fix #Schroedinger

Resources