Problem Compiling

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • MiguelA
    Junior Member
    • Mar 2017
    • 18

    Problem Compiling

    I've been trying for the past few days to compile the source code for FEBio without luck. I've tried using Visual Studio 2017 Community and Visual Studio Express 2013.

    It seems that I have two problems. The first is with the file "svnrev.py". Since I don't have TortoiseSVN installed, I changed the "svnrev.py" file to the version below. Is this safe to do? It seems to compile fine.
    Code:
    #! /usr/bin/env python
    # -*- coding: utf-8 -*-
    import subprocess, sys, os
    
    # Use subwcrev on Windows to determine the svn revision and create svnrev.h
    
    # Find the revision
    proj_dir = os.getcwd()
    #print(proj_dir)
    os.chdir("../..")
    feb_dir = os.getcwd()
    #print(feb_dir)
    try:
    	sub_out = subprocess.Popen(['subwcrev', feb_dir], stdout=subprocess.PIPE).communicate()[0]
    	#print(sub_out)
    	revision_line = sub_out.split("\n")[2]
    	if 'Mixed' in revision_line: revision = revision_line.split(":")[1]
    	elif 'Updated' in revision_line: revision = revision_line.split(" ")[3]
    	else: sys.exit("Error: unknown subwcrev output")
    	#print(revision)
    except:
    	revision = str(0)
    	print('Warning: "subwcrev" not detected, revision number set to 0')
    
    # Write svnrev.h
    f_svnrev = open(feb_dir + "/FEBioLib/svnrev.h", "w")
    f_svnrev.write("//  This file is created by svnrev.py which uses subwcrev in Windows\n")
    f_svnrev.write("//  to determine the svn revision number\n\n")
    f_svnrev.write("#define SVNREVISION  " + revision + "\n")
    f_svnrev.close()

    The second issue seems to be that the compiler is trying to link with the FEBioFluid library, which didn't come in the source code download.

    Here is my workflow in VS2017:
    1- Open Visual Studio (2017)
    2- File>Open>Project/Solution
    3- Select FEBio2.sln in VS2013 folder
    4- Retarget Projects to Windows SDK Version 10.0.14393.0, Platform Toolset: Upgrade to v141
    5- Select Release, Win 32
    6- Build (Ctrl+Shift+B)

    In VS2013 everything is the same but step 4 is not necessary.


    Here is the output (the error part) of building with VS17. With VS13 it is the same except it doesn't have the line that starts with "11>C:\Program..."
    Code:
    11>------ Build started: Project: FEBio2, Configuration: Release Win32 ------
    11>CommandManager.cpp
    11>console.cpp
    11>FEBio.cpp
    11>FEBioCommand.cpp
    11>FEBioStdSolver.cpp
    11>Interrupt.cpp
    11>stdafx.cpp
    11>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(647,5): error MSB6006: "link.exe" exited with code 1181.
    11>LINK : fatal error LNK1181: cannot open input file 'febiofluid.lib'
    11>Done building project "FEBio2.vcxproj" -- FAILED.
    ========== Build: 9 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
    I would be very grateful for any help solving this.

    Best regards,
    Miguel
  • maas
    Lead Code Developer
    • Nov 2007
    • 3400

    #2
    Hi Miguel,

    The febiofluid library is not yet available. I think the web downloaded version did not correctly remove all the febiofluid reference from the code, so you need to make a few changes:
    - If there is a febiofluid project in the solution, remove it.
    - On the FEBio2 project, open the properties dialog, find the Linker settings, and look for the input property. Remove the febiofluid.lib library.
    - In the FEBioLib project, in the febiolib.cpp file, see if the FEBioFluid::InitModule() is removed.

    That should do it. Let us know if you still encounter any problems.

    Cheers,

    Steve
    Department of Bioengineering, University of Utah
    Scientific Computing and Imaging institute, University of Utah

    Comment

    • MiguelA
      Junior Member
      • Mar 2017
      • 18

      #3
      Hi Steve,
      thank you for your reply.

      The febiofluid project was not in the solution. The project folder was still there and I removed it just in case.
      Also the febiofluid.lib library was not present in the FEBio2 linker settings.

      After your suggestion I checked the febiolib.cpp file, but the FEBioFluid::InitModule() was not there either. If fact, I can't find any "FEBioFluid" in all the solution.

      Would you have any additional ideas?

      All the best,
      Miguel

      Comment

      • dsrawlins
        Developer
        • Dec 2008
        • 366

        #4
        Hi Miguel,

        I'll be uploading the 2.6.2 release of the source code in the next few days and I'll make sure that these issues are resolved.

        Cheers,

        Dave
        Department of Bioengineering, University of Utah
        Scientific Computing and Imaging institute, University of Utah

        Comment

        • MiguelA
          Junior Member
          • Mar 2017
          • 18

          #5
          Thank you so much! I look forward to it.

          Best regards,
          Miguel

          Comment

          • MiguelA
            Junior Member
            • Mar 2017
            • 18

            #6
            I was now able to compile using VS2013 Community.

            Just in case someone is struggling, I also needed to install the Intel Performance Libraries 2017 and for some reason I had to reset the Include and the Library Directories in the VC++ Directories:
            Include Directories
            C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.*. ***\windows\mkl\include
            C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.*. ***\windows\mkl\include\ia32

            Library Directories
            C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.*. ***\windows\mkl\lib\ia32_win
            C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.*. ***\windows\compiler\lib\ia32_win
            *for x64 replace ia32 with intel64. Note however that I wasn't able to compile in this case.

            I also had to replace libiomp5mt.lib for libiomp5md.lib in the Linker>Input. As far as I understood, this change makes FEBio use the dynamic link library (dll) for openmp instead of static. Apparently Intel removed the static library from their more recent releases. This meant that I needed to copy the libiomp5md.dll file from the Intel folder into the folder of the compiled FEBio.

            I hope this helps future developers!

            Comment

            • corsair19
              Junior Member
              • Jun 2017
              • 1

              #7
              To add to that, ensure that the intel library DLLs are accessible from PATH. Add these directories to your PATH system variable:

              C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_*. ***\windows\redist\ia32_win\compiler
              C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_*. ***\windows\redist\ia32_win\mkl
              C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_*. ***\windows\redist\ia32_win\tbb

              Alternatively, you can just copy and paste the DLLs from these 3 directories into the same directory as FEBio2.exe.

              Also, you'll need to copy and paste febiosource-2.6.2\build\bin\febio.xml into the FEBio2.exe directory as well.

              Comment

              Working...
              X
              😀
              😂
              🥰
              😘
              🤢
              😎
              😞
              😡
              👍
              👎