Results 1 to 7 of 7

Thread: Problem Compiling

  1. #1
    Join Date
    Mar 2017

    Default 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 "". Since I don't have TortoiseSVN installed, I changed the "" file to the version below. Is this safe to do? It seems to compile fine.
    #! /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()
    feb_dir = os.getcwd()
    	sub_out = subprocess.Popen(['subwcrev', feb_dir], stdout=subprocess.PIPE).communicate()[0]
    	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")
    	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 which uses subwcrev in Windows\n")
    f_svnrev.write("//  to determine the svn revision number\n\n")
    f_svnrev.write("#define SVNREVISION  " + revision + "\n")

    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..."
    11>------ Build started: Project: FEBio2, Configuration: Release Win32 ------
    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,

  2. #2
    Join Date
    Nov 2007
    Salt Lake City, UTAH


    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.


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

  3. #3
    Join Date
    Mar 2017


    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,

  4. #4
    Join Date
    Dec 2008
    Salt Lake City, UT


    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.


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

  5. #5
    Join Date
    Mar 2017


    Thank you so much! I look forward to it.

    Best regards,

  6. #6
    Join Date
    Mar 2017


    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!

  7. #7
    Join Date
    Jun 2017


    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts