New Reply

Command /bin/sh failed with exit code 2

 
Share Thread Thread Tools
Feb2-12, 03:24 PM   #1
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
Retired Staff Staff Emeritus

Command /bin/sh failed with exit code 2


I'm trying to build code in Xcode, but I keep getting the following error:

Code:
xcodebuild[17565:903] Unexpected character / at line 1
xcodebuild: error: Unable to read project 'VTK.xcodeproj'.
Reason: Project ../VTK.xcodeproj cannot be opened because the project file cannot be parsed.

make: *** [../VTK-build] Error 74
Command /bin/sh failed with exit code 2
I tried to edit the file causing the error, but I can't see what's wrong with it. Line 1 says: // !$*UTF8*$!

Does anyone have a clue what could be the cause?
 
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> 'Whodunnit' of Irish potato famine solved
>> The mammoth's lament: Study shows how cosmic impact sparked devastating climate change
>> Curiosity Mars rover drills second rock target
Feb3-12, 02:12 AM   #2
 
Recognitions:
Homework Helper Homework Help
The error means that the system tries to execute the file VTK.xcodeproj as if it is a script file, but it isn't.
It's a project file that should be loaded by some program.
I suspect it means that you are missing a program on your system.

In the file named "Makefile" there should be a line somewhere with the text "VTK.xcodeproj".
It should have something in front of it that is the program to be used to load it.
That may give a hint of what you're missing.

Anyway, you can probably solve it by reading some of the installation instructions.
 
Feb3-12, 02:36 AM   #3
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
Retired Staff Staff Emeritus
Shouldn't VTK.xcodeproj be able to open in Xcode? I have other .xcodeproj files that do.

The installation instructions are not very helpful. It says to configure and generate the superbuild files in cmake and then make the files with "make -j9". That's it
 
Feb3-12, 03:28 AM   #4
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
Retired Staff Staff Emeritus

Command /bin/sh failed with exit code 2


I tried an alternate approach, install via macports. Here I also get an error and again something about undefined symbols? Other software installs just fine, this is annoying.

Code:
$ sudo port install VTK
--->  Computing dependencies for VTK
--->  Fetching archive for VTK
--->  Attempting to fetch VTK-4.4.2_0.darwin_10.x86_64.tbz2 from http://packages.macports.org/VTK
--->  Fetching VTK
--->  Attempting to fetch VTK-4.4.2.tar.gz from http://lil.fr.distfiles.macports.org/VTK
--->  Verifying checksum(s) for VTK
--->  Extracting VTK
--->  Applying patches to VTK
--->  Configuring VTK
--->  Building VTK
Error: Target org.macports.build returned: shell command failed (see log for details)
Log for VTK is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_vtk/VTK/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>
Code:
Last part of the log:

:info:build Undefined symbols for architecture x86_64:
:info:build   "_oft_initCommon", referenced from:
:info:build      -init command line option
:info:build ld: symbol(s) not found for architecture x86_64
:info:build collect2: ld returned 1 exit status
:info:build make[2]: *** [bin/libvtkCommon.dylib] Error 1
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_vtk/VTK/work/VTK'
:info:build make[1]: *** [Common/CMakeFiles/vtkCommon.dir/all] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_vtk/VTK/work/VTK'
:info:build make: *** [all] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_vtk/VTK/work/VTK'
:info:build shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_vtk/VTK/work/VTK" && /usr/bin/make -j4 -w all " returned error 2
:error:build Target org.macports.build returned: shell command failed (see log for details)
:debug:build Backtrace: shell command failed (see log for details)
    while executing
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
:info:build Warning: the following items did not execute (for VTK): org.macports.activate org.macports.build org.macports.destroot org.macports.install
:notice:build Log for VTK is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_graphics_vtk/VTK/main.log
 
Feb3-12, 04:31 AM   #5
 
Recognitions:
Homework Helper Homework Help
Quote by Monique View Post
Shouldn't VTK.xcodeproj be able to open in Xcode? I have other .xcodeproj files that do.
Did you try to open VTK.xcodeproj with Xcode?
Can you find a reference in the Makefile to VTK.xcodeproj?


The installation instructions are not very helpful. It says to configure and generate the superbuild files in cmake and then make the files with "make -j9". That's it
Did you carefully monitor the build process and check for warnings or errors?
You say "configure", so did you configure anything?
 
Feb3-12, 06:43 AM   #6
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
Retired Staff Staff Emeritus
Quote by I like Serena View Post
Did you try to open VTK.xcodeproj with Xcode?
Yes, I get a parse error.
Can you find a reference in the Makefile to VTK.xcodeproj?
no, I don't

Did you carefully monitor the build process and check for warnings or errors?
Yes, I posted it in the first post and again in the later post with the other approach.
You say "configure", so did you configure anything?
I used default settings to generate the build files.

I tried installing another dependency VXL and that fails as well. I'm starting to think the only solution is to wipe my computer clean and install everything from scratch :( which I don't want to do.
 
Feb3-12, 10:29 AM   #7
 
Recognitions:
Homework Helper Homework Help
Let me see if I understand the situation correctly.

Do you have a working Xcode?
Are you programming in Xcode for that matter?
Can you build other projects?

What kind of project is VTK?
Is it a project you downloaded and are building from source?

You said you tried to edit the file causing the error.
Which file did you mean?
 
Feb5-12, 03:10 PM   #8
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
Retired Staff Staff Emeritus
Quote by I like Serena View Post
Let me see if I understand the situation correctly.

Do you have a working Xcode?
Are you programming in Xcode for that matter?
Can you build other projects?
yes, yes, yes.

What kind of project is VTK?
Is it a project you downloaded and are building from source?
vtk.org, yes

You said you tried to edit the file causing the error.
Which file did you mean?
VTK.xcodeproj, the file that can not be parsed.

Here is the part of the building process that gives errors and causes the premature abortion of make:
Code:
[ 32%] Building CXX object core/vil/CMakeFiles/vil.dir/file_formats/vil_jpeg.o
[ 32%] Building CXX object core/vil/CMakeFiles/vil.dir/file_formats/vil_jpeg_source_mgr.o
[ 33%] Building CXX object core/vil/CMakeFiles/vil.dir/file_formats/vil_jpeg_decompressor.o
[ 33%] Building CXX object core/vil/CMakeFiles/vil.dir/file_formats/vil_jpeg_destination_mgr.o
[ 33%] Building CXX object core/vil/CMakeFiles/vil.dir/file_formats/vil_jpeg_compressor.o
[ 33%] Building CXX object core/vil/CMakeFiles/vil.dir/file_formats/vil_openjpeg.o
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:107: error: ISO C++ forbids declaration of ‘/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:107: error: expected ‘;’ before ‘*’ token
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:109: error: ISO C++ forbids declaration of ‘opj_stream_t’ with no type
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:109: error: expected ‘;’ before ‘*’ token
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:146: error: ISO C++ forbids declaration of ‘opj_codec_t’ with no type
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:146: error: expected ‘;’ before ‘*’ token
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx: In constructor ‘vil_openjpeg_image_impl::vil_openjpeg_image_impl()’:
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:158: error: class ‘vil_openjpeg_image_impl’ does not have any field named ‘encode_codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx: In constructor ‘vil_openjpeg_decoder::vil_openjpeg_decoder(OPJ_CODEC_FORMAT)’:
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:174: error: class ‘vil_openjpeg_decoder’ does not have any field named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:174: error: class ‘vil_openjpeg_decoder’ does not have any field named ‘stream_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx: In destructor ‘vil_openjpeg_decoder::~vil_openjpeg_decoder()’:
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:186: error: ‘class vil_openjpeg_decoder’ has no member named ‘stream_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:188: error: ‘class vil_openjpeg_decoder’ has no member named ‘stream_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:188: error: ‘opj_stream_destroy’ was not declared in this scope
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:189: error: ‘class vil_openjpeg_decoder’ has no member named ‘stream_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:191: error: ‘class vil_openjpeg_decoder’ has no member named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:193: error: ‘class vil_openjpeg_decoder’ has no member named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:193: error: ‘opj_destroy_codec’ was not declared in this scope
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:194: error: ‘class vil_openjpeg_decoder’ has no member named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx: In member function ‘bool vil_openjpeg_decoder::init_stream(void*)’:
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:241: error: ‘class vil_openjpeg_decoder’ has no member named ‘stream_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:243: error: ‘class vil_openjpeg_decoder’ has no member named ‘stream_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:243: error: ‘opj_stream_destroy’ was not declared in this scope
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:244: error: ‘class vil_openjpeg_decoder’ has no member named ‘stream_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:248: error: ‘class vil_openjpeg_decoder’ has no member named ‘stream_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:248: error: ‘opj_stream_default_create’ was not declared in this scope
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:249: error: ‘class vil_openjpeg_decoder’ has no member named ‘stream_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:253: error: ‘class vil_openjpeg_decoder’ has no member named ‘stream_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:253: error: ‘opj_stream_set_user_data’ was not declared in this scope
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:254: error: ‘class vil_openjpeg_decoder’ has no member named ‘stream_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:255: error: ‘opj_stream_set_read_function’ was not declared in this scope
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:256: error: ‘class vil_openjpeg_decoder’ has no member named ‘stream_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:257: error: ‘opj_stream_set_write_function’ was not declared in this scope
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:258: error: ‘class vil_openjpeg_decoder’ has no member named ‘stream_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:259: error: ‘opj_stream_set_skip_function’ was not declared in this scope
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:260: error: ‘class vil_openjpeg_decoder’ has no member named ‘stream_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:261: error: ‘opj_stream_set_seek_function’ was not declared in this scope
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx: In member function ‘bool vil_openjpeg_decoder::init_decoder(unsigned int)’:
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:271: error: ‘class vil_openjpeg_decoder’ has no member named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:273: error: ‘class vil_openjpeg_decoder’ has no member named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:273: error: ‘opj_destroy_codec’ was not declared in this scope
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:274: error: ‘class vil_openjpeg_decoder’ has no member named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:284: error: ‘class vil_openjpeg_decoder’ has no member named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:285: error: ‘class vil_openjpeg_decoder’ has no member named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:289: error: ‘class vil_openjpeg_decoder’ has no member named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:290: error: ‘opj_set_info_handler’ was not declared in this scope
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:291: error: ‘class vil_openjpeg_decoder’ has no member named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:292: error: ‘opj_set_warning_handler’ was not declared in this scope
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:293: error: ‘class vil_openjpeg_decoder’ has no member named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:294: error: ‘opj_set_error_handler’ was not declared in this scope
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:297: error: ‘class vil_openjpeg_decoder’ has no member named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx: In member function ‘bool vil_openjpeg_decoder::read_header()’:
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:316: error: ‘class vil_openjpeg_decoder’ has no member named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:324: error: ‘class vil_openjpeg_decoder’ has no member named ‘stream_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:324: error: ‘opj_read_header’ was not declared in this scope
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx: In member function ‘bool vil_openjpeg_decoder::set_decode_area(unsigned int, unsigned int, unsigned int, unsigned int)’:
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:334: error: ‘class vil_openjpeg_decoder’ has no member named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:334: error: ‘opj_set_decode_area’ was not declared in this scope
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx: In member function ‘opj_image_t* vil_openjpeg_decoder::decode()’:/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:353: error: ‘class vil_openjpeg_decoder’ has no member named ‘codec_’
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx:353: error: ‘class vil_openjpeg_decoder’ has no member named ‘stream_’
make[5]: *** [core/vil/CMakeFiles/vil.dir/file_formats/vil_openjpeg.o] Error 1
make[4]: *** [core/vil/CMakeFiles/vil.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [ExternalProjects/Stamp/VXL/VXL-build] Error 2
make[1]: *** [CMakeFiles/VXL.dir/all] Error 2
make: *** [all] Error 2
sh-3.2# make
 
Feb5-12, 03:19 PM   #9
 
Recognitions:
Homework Helper Homework Help
Do these compilation errors occur before the error you had on the unexpected '/'?

What does line 107 say in the following file?
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx
 
Feb5-12, 03:46 PM   #10
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
Retired Staff Staff Emeritus
Quote by I like Serena View Post
Do these compilation errors occur before the error you had on the unexpected '/'?
These compilation errors I get when I perform make in my terminal window. Sorry, I did not use Xcode in this attempt because I'm trying different things to get to the bottom of it () So, the compilation errors in my previous post are the first that I encounter in that attempt.

What does line 107 say in the following file?
/ExternalProjects/Source/VXL/core/vil/file_formats/vil_openjpeg.cxx
It says:
opj_codec_t *codec_;

Thanks so much for thinking along, I never encountered problems before that I couldn't solve.
 
Feb5-12, 04:01 PM   #11
 
Recognitions:
Homework Helper Homework Help
Quote by Monique View Post
It says:
opj_codec_t *codec_;
That would suggest that the type opj_codec_t is unknown.
Since it would have been defined in an earlier include, that suggests a versioning problem.
It seems it should have been defined as part of the openjpeg library (openjpeg.h), which contains similar definitions.
Can you trace where opj_codec_t should come from?
Perhaps a "grep" on the openjpeg include files?

Thanks so much for thinking along, I never encountered problems before that I couldn't solve.
Welcome to the club.
 
New Reply
Thread Tools


Similar Threads for: Command /bin/sh failed with exit code 2
Thread Forum Replies
Can someone look over my C++ code - Simple short code! Engineering, Comp Sci, & Technology Homework 4
Suggestion Add code tag to [code] [/code] block Forum Feedback & Announcements 4
Recursion code for generating Gray Code in C Engineering, Comp Sci, & Technology Homework 1
MATLAB save command and transpose command Math & Science Software 4
Convert latex code to fortran code? Math & Science Software 1