Coder Social home page Coder Social logo

Add a .def file for Windows builds about rosco HOT 4 CLOSED

nrel avatar nrel commented on August 24, 2024
Add a .def file for Windows builds

from rosco.

Comments (4)

rafmudaf avatar rafmudaf commented on August 24, 2024

I thought thats what this line does. How are you looking to see the other symbols exported in the DLL? I'm not too familiar with building software on Windows, but I can try to find a good solution for this. Ideally, these files are autogenerated by CMake or this information is implicit in the code.

from rosco.

davidheff avatar davidheff commented on August 24, 2024

OK, I may have got this wrong. I'd been building with -DIMPLICIT_DLLEXPORT which I had just picked up from

if(APPLE OR UNIX)
  if (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
    set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DIMPLICIT_DLLEXPORT ")
  else()
    set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DIMPLICIT_DLLEXPORT -ffree-line-length-0")
  endif()
endif()

But that results in all symbols being exported, which isn't what you want.

What I will do is look at the openfast CMakeLists.txt as you suggested on my other issue and see if I can come up with something definitive.

from rosco.

rafmudaf avatar rafmudaf commented on August 24, 2024

Right, my understanding of this was that Windows needs the explicit export preprocessor directive to export any symbols in a DLL. I thought that the default was to export no symbols on Windows, but I may be wrong.

from rosco.

davidheff avatar davidheff commented on August 24, 2024

Yeah, I've confirmed that my mistake was using -DIMPLICIT_DLLEXPORT.

I'm pretty sure that what is needed, at least for an MSYS2 build under mingw-w64 is:

set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -static-libgcc -static-libgfortran -static")

from rosco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.