Re: [magenta-discuss] OS X: tests fail with 'unrecognized command line option'

307 views
Skip to first unread message

NetDFS Com

unread,
Jun 26, 2016, 1:45:51 AM6/26/16
to Scott Hawley, magenta...@tensorflow.org
Hello.

Do you have the required build tool installed? What is the output from running the command

'bazel version'

and is it in your /usr/local/bin/bazel path?

On Fri, Jun 24, 2016 at 7:26 PM, Scott Hawley <mcsk...@gmail.com> wrote:

Hi.  I'm unable to run the tests.   I already had TensorFlow installed.

Tonight I installed bazel via then binary installer, on  Mac OS X El Capitan, 10.11.5 and MacPorts.


Then ran...

% bazel test //magenta:all

.

WARNING: /private/var/tmp/_bazel_myusername/ddd9d9dc1e025ace939596b3e248324a/external/protobuf/WORKSPACE:1: Workspace name in /private/var/tmp/_bazel_myusername/ddd9d9dc1e025ace939596b3e248324a/external/protobuf/WORKSPACE (@__main__) does not match the name given in the repository's definition (@protobuf); this will cause a build error in future versions.

INFO: Found 9 targets and 6 test targets...

ERROR: /private/var/tmp/_bazel_myusername/ddd9d9dc1e025ace939596b3e248324a/external/protobuf/BUILD:71:1: C++ compilation of rule '@protobuf//:protobuf_lite' failed: cc_wrapper.sh failed: error executing command external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wthread-safety -Wself-assign -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG ... (remaining 36 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.

cc1plus: error: unrecognized command line option "-Wthread-safety"

cc1plus: error: unrecognized command line option "-Wself-assign"

cc1plus: warning: unrecognized command line option "-Wno-free-nonheap-object"

INFO: Elapsed time: 27.281s, Critical Path: 0.22s

//magenta:basic_one_hot_encoder_test                                  NO STATUS

//magenta:convert_midi_dir_to_note_sequences_test                     NO STATUS

//magenta:melodies_lib_test                                           NO STATUS

//magenta:midi_io_test                                                NO STATUS

//magenta:note_sequence_io_test                                       NO STATUS

//magenta:sequence_to_melodies_test                                   NO STATUS


Executed 0 out of 6 tests: 6 were skipped.

%




Perhaps it's a gcc version error?   Most of my build tools will pull from my environment and then use the "MacPorts" compilers...


% env | /usr/bin/grep CC

CC=/opt/local/bin/gcc-mp-4.4

% env | /usr/bin/grep CXX

CXX=/opt/local/bin/g++-mp-4.4


...but I leave the default "gcc" to refer to Apple's executable:


% which gcc

/Applications/XCode.app/Contents/Developer/usr/bin/gcc



Tried it in both tcsh (my usual) and bash.  Stuck.


Any suggestions?





















































--
Magenta project: magenta.tensorflow.org
To post to this group, send email to magenta...@tensorflow.org
To unsubscribe from this group, send email to magenta-discu...@tensorflow.org
---
You received this message because you are subscribed to the Google Groups "Magenta Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to magenta-discu...@tensorflow.org.

Eric Wolf

unread,
Dec 14, 2016, 7:55:41 AM12/14/16
to Magenta Discuss, mcsk...@gmail.com
I'm running into the same issue, I've already spent a few hours trying to get Magenta to work on Mac OS 10.11.6.

g++ and gcc should both point to Apple's compiler:
i686-apple-darwin15-gcc-apple-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) (MacPorts apple-gcc42 5666.3_15)
 
I installed Bazel from Homebrew, it is in /usr/local/bin/bazel:
Build label: 0.4.2-homebrew
Build target: bazel-out/local-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Dec 8 03:14:36 2016 (1481166876)
Build timestamp: 1481166876
Build timestamp as int: 1481166876

This is where the error occurs:
>>>>> # @protobuf//:protobuf_lite [action 'Compiling external/protobuf/src/google/protobuf/stubs/strutil.cc [for host]']
(cd /private/var/tmp/_bazel_ew/a3f93a71053172e3592585ee68c6835c/execroot/magenta && \
  exec env - \
    PATH=/usr/local/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin \
    TMPDIR=/var/folders/9_/pp_qbzl53_5_v4vrl3sxgdbh0000gn/T/ \
  external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections -g0 '-std=c++0x' -MD -MF bazel-out/host/bin/external/protobuf/_objs/protobuf_lite/external/protobuf/src/google/protobuf/stubs/strutil.d '-frandom-seed=bazel-out/host/bin/external/protobuf/_objs/protobuf_lite/external/protobuf/src/google/protobuf/stubs/strutil.o' -iquote external/protobuf -iquote bazel-out/host/genfiles/external/protobuf -iquote external/bazel_tools -iquote bazel-out/host/genfiles/external/bazel_tools -isystem external/protobuf/src -isystem bazel-out/host/genfiles/external/protobuf/src -isystemexternal/bazel_tools/tools/cpp/gcc3 -DHAVE_PTHREAD -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare '-Wnoerror=unused-function' -Wno-builtin-macro-redefined '-D__DATE__="redacted"' ' D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/protobuf/src/google/protobuf/stubs/strutil.cc -o bazelout/host/bin/external/protobuf/_objs/protobuf_lite/external/protobuf/src/google/protobuf/stubs/strutil.o)
ERROR: /private/var/tmp/_bazel_ew/a3f93a71053172e3592585ee68c6835c/external/protobuf/BUILD:71:1: C++ compilation of rule '@protobuf//:protobuf_lite' failed: cc_wrapper.sh failed:
 error executing command external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections ... (remaining 35 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.

cc1plus: error: unrecognized command line option "-Wthread-safety"
cc1plus: error: unrecognized command line option "-Wself-assign"
cc1plus: error: unrecognized command line option "-Wno-builtin-macro-redefined"
cc1plus: error: unrecognized command line option "-std=c++0x"
 
cc_wrapper.sh uses /opt/local/bin/gcc, which is the default mentioned above.

The error is similar to these issues from Tensorflow and Bazel:

However, I'm still not clear how to resolve it. I tried installing various versions of GCC and Bazel and updating Apple's command line tools, to no avail.

Any suggestions?

Best,

Eric

Curtis "Fjord" Hawthorne

unread,
Dec 19, 2016, 12:49:30 PM12/19/16
to Eric Wolf, Magenta Discuss, mcsk...@gmail.com
I'm not sure exactly what's causing the issue, but it does sound like some sort of conflict between gcc versions. Could you try uninstalling the macports version temporarily to see if that fixes the issue?

NetDFS Com

unread,
Jan 7, 2017, 7:00:11 PM1/7/17
to Curtis Fjord Hawthorne, Eric Wolf, Magenta Discuss, Scott Hawley
Hello.

It works fine for me using the latest Magenta version.

gcc

gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin


bazel, tensorflow

pip show tensorflow
bazel version
brew update
brew cleanup
brew upgrade bazel

sudo pip install --upgrade $TF_BINARY_URL


magenta 

cd magenta-master


test

bazel test //magenta/...
...
WARNING: /private/var/tmp/_bazel_user/237bacb2c0c074fb8d30c4e6b2aa2faf/external/protobuf/WORKSPACE:1: Workspace name in /private/var/tmp/_bazel_user/237bacb2c0c074fb8d30c4e6b2aa2faf/external/protobuf/WORKSPACE (@__main__) does not match the name given in the repository's definition (@protobuf); this will cause a build error in future versions.
INFO: Found 103 targets and 35 test targets...
INFO: Elapsed time: 123.909s, Critical Path: 111.34s
//magenta/common:concurrency_test                               (cached) PASSED in 10.7s
//magenta/common:tf_lib_test                                    (cached) PASSED in 5.1s
//magenta/music:chord_symbols_lib_test                          (cached) PASSED in 2.4s
//magenta/interfaces/midi:midi_hub_test                                  PASSED in 21.7s
//magenta/models/drums_rnn:drums_rnn_create_dataset_test                 PASSED in 4.4s
//magenta/models/improv_rnn:improv_rnn_create_dataset_test               PASSED in 3.6s
//magenta/models/melody_rnn:melody_rnn_create_dataset_test               PASSED in 2.6s
//magenta/models/polyphony_rnn:polyphony_encoder_decoder_test            PASSED in 3.3s
//magenta/models/polyphony_rnn:polyphony_lib_test                        PASSED in 3.2s
//magenta/models/polyphony_rnn:polyphony_rnn_create_dataset_test         PASSED in 5.5s
//magenta/models/rl_tuner:rl_tuner_test                                  PASSED in 88.7s
//magenta/models/shared:events_rnn_graph_test                            PASSED in 14.1s
//magenta/music:chords_encoder_decoder_test                              PASSED in 3.0s
//magenta/music:chords_lib_test                                          PASSED in 2.8s
//magenta/music:drums_encoder_decoder_test                               PASSED in 3.0s
//magenta/music:drums_lib_test                                           PASSED in 3.1s
//magenta/music:encoder_decoder_test                                     PASSED in 2.0s
//magenta/music:events_lib_test                                          PASSED in 5.4s
//magenta/music:lead_sheets_lib_test                                     PASSED in 2.9s
//magenta/music:melodies_lib_test                                        PASSED in 2.8s
//magenta/music:melody_encoder_decoder_test                              PASSED in 3.7s
//magenta/music:midi_io_test                                             PASSED in 14.3s
//magenta/music:musicxml_parser_test                                     PASSED in 12.4s
//magenta/music:note_sequence_io_test                                    PASSED in 2.6s
//magenta/music:sequence_generator_test                                  PASSED in 2.3s
//magenta/music:sequences_lib_test                                       PASSED in 2.7s
//magenta/pipelines:chord_pipelines_test                                 PASSED in 2.8s
//magenta/pipelines:dag_pipeline_test                                    PASSED in 2.7s
//magenta/pipelines:drum_pipelines_test                                  PASSED in 4.5s
//magenta/pipelines:lead_sheet_pipelines_test                            PASSED in 2.9s
//magenta/pipelines:melody_pipelines_test                                PASSED in 2.8s
//magenta/pipelines:pipeline_test                                        PASSED in 2.3s
//magenta/pipelines:pipelines_common_test                                PASSED in 2.9s
//magenta/pipelines:statistics_test                                      PASSED in 5.4s
//magenta/scripts:convert_dir_to_note_sequences_test                     PASSED in 3.6s

Executed 32 out of 35 tests: 35 tests pass.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.

To unsubscribe from this group, send email to magenta-discuss+unsubscribe@tensorflow.org

---
You received this message because you are subscribed to the Google Groups "Magenta Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to magenta-discuss+unsubscribe@tensorflow.org.

--
Magenta project: magenta.tensorflow.org
To post to this group, send email to magenta...@tensorflow.org
To unsubscribe from this group, send email to magenta-discuss+unsubscribe@tensorflow.org

---
You received this message because you are subscribed to the Google Groups "Magenta Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to magenta-discuss+unsubscribe@tensorflow.org.

Reply all
Reply to author
Forward
0 new messages