Error in build 64 bit version of MOAB in Windows 7 + VS2012 environment

Issue #1 resolved
tang laoya created an issue

Dear all,

I am trying to build the 64 bit version of MOAB by CMake in Windows 7 + VS2012 environment. I noticed that there are some header files are not included so I added some include directories in moab\src\CMakeLists.txt:

include_directories( ${MOAB_BINARY_DIR} ${MOAB_SOURCE_DIR}/src ${MOAB_BINARY_DIR}/src ${MOAB_SOURCE_DIR}/src/io ${MOAB_SOURCE_DIR}/src/LocalDiscretization ${MOAB_SOURCE_DIR}/src/moab ${MOAB_SOURCE_DIR}/src/moab/point_locater ${MOAB_SOURCE_DIR}/src/moab/point_locater/element_maps ${MOAB_SOURCE_DIR}/src/moab/point_locater/tree ${MOAB_SOURCE_DIR}/src/parallel ${MOAB_BINARY_DIR}/src/parallel ${MOAB_SOURCE_DIR}/src/moab/point_locater/lotte )

However, after generated the solution suitable for VS2012 and build the code, there are still thousands of errors, for example: \moab\src\moab/Core.hpp(62): error C2079: 'moab::Core::dllexport' uses undefined class 'moab::__dllspec'

Error 11 error C1083: Cannot open include file: 'sys/resource.h': No such file or directory

and so on.

What have I missed?

Thanks, Tang Laoya

Comments (14)

  1. tang laoya reporter

    After clicked 'Configure' in CMake, the message of CMake is as follows:

    Check for working C compiler using: Visual Studio 11 Win64 Check for working C compiler using: Visual Studio 11 Win64 -- works Detecting C compiler ABI info Detecting C compiler ABI info - done Check for working CXX compiler using: Visual Studio 11 Win64 Check for working CXX compiler using: Visual Studio 11 Win64 -- works Detecting CXX compiler ABI info Detecting CXX compiler ABI info - done Looking for inttypes.h Looking for inttypes.h - not found Looking for stdint.h Looking for stdint.h - found Looking for stddef.h Looking for stddef.h - found Looking for stdlib.h Looking for stdlib.h - found Looking for sys/types.h Looking for sys/types.h - found Looking for memory.h Looking for memory.h - found Check size of size_t Check size of size_t - done Check size of ptrdiff_t Check size of ptrdiff_t - done CMake Warning (dev) at tools/CMakeLists.txt:110 (add_subdirectory): Policy CMP0013 is not set: Duplicate binary directories are not allowed. Run "cmake --help-policy CMP0013" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

    The binary directory

    E:/Users/tang/tang/mesh/MeshKit/meshkit/meshkit_mesquite/moab/64bit/tools/dagmc
    

    is already used to build a source directory. This command uses it to build source directory

    E:/Users/tang/tang/mesh/MeshKit/meshkit/meshkit_mesquite/moab/tools/dagmc
    

    which can generate conflicting build files. CMake does not support this use case but it used to work accidentally and is being allowed for compatibility. This warning is for project developers. Use -Wno-dev to suppress it.

    CMake Warning (dev) at tools/dagmc/CMakeLists.txt:32 (add_library): Policy CMP0002 is not set: Logical target names must be globally unique. Run "cmake --help-policy CMP0002" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it.

    CMake Warning (dev) at tools/dagmc/CMakeLists.txt:39 (add_executable): Policy CMP0002 is not set: Logical target names must be globally unique. Run "cmake --help-policy CMP0002" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it.

    Configuring done

  2. tang laoya reporter

    Dear developer,

    I have successfully built the MOAB static library in Windows 7 + VS2012 environment after modified some source code files. If possible, I would like upload the modified code for your check.

    Thanks, Tang Laoya

  3. Vijay M

    Tang, there is a pull request pending by Jason regarding CMake for Windows which will be reviewed in the coming week. If you have a lot of changes along the same lines, do submit a pull request and we can get both the features tested and merged in one shot. Thanks.

    Vijay

  4. Vijay M

    Tang, can you try the latest sources and see if your patches are still needed ? If they are, please submit a pull request and we can check/merge them for the upcoming release.

  5. tang laoya reporter

    Dear Prof. Mahadevan,

    I am sorry that I am busy in a project and didn't response this issue for a long time. Just a quick result when built by the latest code:

    The CMake 3.0.2 is used and build environment is Windows 7 64 bit + VS2013

    built version is 64bit, without any change of configure settings and just click 'Configure' and 'Generate', the following message displayed:

    Checking for non-MPI native compilers
    The C compiler identification is MSVC 18.0.30723.0
    The CXX compiler identification is MSVC 18.0.30723.0
    Check for working C compiler using: Visual Studio 12 2013 Win64
    Check for working C compiler using: Visual Studio 12 2013 Win64 -- works
    Detecting C compiler ABI info
    Detecting C compiler ABI info - done
    Check for working CXX compiler using: Visual Studio 12 2013 Win64
    Check for working CXX compiler using: Visual Studio 12 2013 Win64 -- works
    Detecting CXX compiler ABI info
    Detecting CXX compiler ABI info - done
    Performing Test MOAB_HAVE_FLAG_pedantic
    Performing Test MOAB_HAVE_FLAG_pedantic - Failed
    Looking for inttypes.h
    Looking for inttypes.h - found
    Looking for stdint.h
    Looking for stdint.h - found
    Looking for stddef.h
    Looking for stddef.h - found
    Looking for stdlib.h
    Looking for stdlib.h - found
    Looking for sys/types.h
    Looking for sys/types.h - found
    Looking for sys/types.h
    Looking for sys/types.h - found
    Looking for stdint.h
    Looking for stdint.h - found
    Looking for stddef.h
    Looking for stddef.h - found
    Check size of size_t
    Check size of size_t - done
    Check size of ptrdiff_t
    Check size of ptrdiff_t - done
    Looking for memory.h
    Looking for memory.h - found
    Check size of size_t
    Check size of size_t - done
    Check size of ptrdiff_t
    Check size of ptrdiff_t - done
    Could NOT find CGM (missing:  CGM_INCLUDE_DIRS CGM_LIBRARIES) 
    Configuring done
    CMake Error at src/CMakeLists.txt:214 (add_library):
      Objects of target "moabpar" referenced but no such target exists.
    
    
    Generating done
    

    The project is failed to generate.

    Latter I will try to check what I should check furthermore.

    Thanks, Tang Laoya

  6. Vijay M

    This has been fixed. We are getting ready for a release and so if you can recheck and let us know, that would be extremely helpful!

  7. tang laoya reporter

    Dear Prof. Vijay Mahadevan,

    I am sorry for late reply. After a quick test I have the following result (unfortunately it is still not successful). The test is done by Windows 7 64bit + CMake 3.0.2 + VS2013 In addition, two source code is modified to let it be able to be compiled in VS2013 and attached.

    Thanks, Tang Laoya

    1>------ Build started: Project: ZERO_CHECK, Configuration: Release x64

  8. Vijay M

    Can you send us a patch on what you modified. I don't see anything useful in the above message. Not sure if you meant to attach a file ?

  9. tang laoya reporter

    Dear Prof. Vijay Mahadevan,

    I have attached the modified files in my previous email. Here I attached the files again.

    Thanks, Tang Laoya

  10. Vijay M

    Thanks, we'll take a look at it. There is also a cmake branch for Windows that's in progress, which might resolve a lot of your issues.

  11. Vijay M
    • edited description
    • changed status to resolved

    There are updates already in MOAB master and a pending PR with changes for Windows builds using CMake. These changes have also been tested with VS2015 and VS2017 with Eigen3 dependency instead of BLAS/LAPACK.

  12. Log in to comment