microsoft / CNTK

Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
https://docs.microsoft.com/cognitive-toolkit/
Other
17.5k stars 4.29k forks source link

unrecognized command line option '-msse4.1' #3754

Open haryngod opened 4 years ago

haryngod commented 4 years ago

Build environment is 'Jetson AGX Xavier'(ARM cpu), Ubuntu 18.04, gcc 7.4.0. I'd like to build with swig option to make csharp libraries to get CNTK GPU version on it. Since I put yes to 'enble_csharp' in build configuration. However, it got build fail since 'unrecognized command line optipn '-mees4.1''

I'd like to know, how can I solve it and could I build with swig option with my environment?.

Compile messages here.

[ 33%] Generating SWIG Proxies for C++ and C#
=-----------------------------------------------------------=
….

/home/aiware/repos/CNTK/bindings/csharp/Swig/../../../Source/CNTKv2LibraryDll/API/CNTKLibraryInternals.h:100: Warning 302: Identifier 'ThrowFormatted' redefined (ignored),
/home/aiware/repos/CNTK/bindings/csharp/Swig/../../../Source/CNTKv2LibraryDll/API/CNTKLibraryInternals.h:96: Warning 302: previous definition of 'ThrowFormatted'.
Scanning dependencies of target CSharpBindings
make[3]: Leaving directory '/home/aiware/repos/CNTK/bindings/csharp/Swig/build/Linux/Release'
make[3]: Entering directory '/home/aiware/repos/CNTK/bindings/csharp/Swig/build/Linux/Release'
[ 66%] Building CXX object CMakeFiles/CSharpBindings.dir/Generated/cntk_cs_wrap.cxx.o
c++: error: unrecognized command line option ‘-msse4.1’
CMakeFiles/CSharpBindings.dir/build.make:79: recipe for target 'CMakeFiles/CSharpBindings.dir/Generated/cntk_cs_wrap.cxx.o' failed
make[3]: *** [CMakeFiles/CSharpBindings.dir/Generated/cntk_cs_wrap.cxx.o] Error 1
make[3]: Leaving directory '/home/aiware/repos/CNTK/bindings/csharp/Swig/build/Linux/Release'
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/CSharpBindings.dir/all' failed
make[2]: *** [CMakeFiles/CSharpBindings.dir/all] Error 2
make[2]: Leaving directory '/home/aiware/repos/CNTK/bindings/csharp/Swig/build/Linux/Release'
Makefile:83: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/aiware/repos/CNTK/bindings/csharp/Swig/build/Linux/Release'
Makefile:1649: recipe for target 'csharp' failed
make: *** [csharp] Error 2
make: Leaving directory '/home/aiware/repos/CNTK'
haryngod commented 4 years ago

I found comments in top-level Makefile.

I uncommented that lines, but I'm not quite sure it's correct or not. Since I couldn't successfully build because of MPI compile errors. Am I on the right way?

haryngod commented 4 years ago

After I did the above job, a new error occurred undefined reference to MPI libraries and headers. #3755.

haryngod commented 4 years ago

I found -msse4.1 flag in the cpp_common.cmake.

    add_compile_options(                                                                    
        -fcheck-new
        -fopenmp
        -fpermissive
        -fPIC
        -msse4.1
        -std=c++11
        -Wall
        -Wextra
        # TODO: -Werror 
    )

I commented it manually and I success compile with swig option in my environment.

P.S. During this step I need to install dotnet core with following steps.

curl -SL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-l
inux-arm64.tar.gz
sudo mkdir -p /usr/share/dotnet
sudo tar -zxf dotnet.tar.gz -C /usr/share/dotnet
sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet