Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add gklib #12547

Merged
merged 24 commits into from
Jan 7, 2021
Merged

add gklib #12547

merged 24 commits into from
Jan 7, 2021

Conversation

hadim
Copy link
Member

@hadim hadim commented Sep 3, 2020

Checklist

  • Title of this PR is meaningful: e.g. "Adding my_nifty_package", not "updated meta.yaml"
  • License file is packaged (see here for an example)
  • Source is from official source
  • Package does not vendor other packages. (If a package uses the source of another package, they should be separate packages or the licenses of all packages need to be packaged)
  • If static libraries are linked in, the license of the static library is packaged.
  • Build number is 0
  • A tarball (url) rather than a repo (e.g. git_url) is used in your recipe (see here for more details)
  • GitHub users listed in the maintainer section have posted a comment confirming they are willing to be listed there

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/gklib) and found it was in an excellent condition.

@hadim
Copy link
Member Author

hadim commented Sep 3, 2020

@conda-forge/staged-recipes ready for review

recipes/gklib/meta.yaml Outdated Show resolved Hide resolved
@hadim
Copy link
Member Author

hadim commented Dec 29, 2020

I don't know how to fix the windows build so I have disabled it for now. Besides that LGTM.

@conda-forge/help-c-cpp can you review please?

@SimonBoothroyd
Copy link
Contributor

@hadim I think the build failures on windows are due to how shared libraries are generated on windows (some background here). We can probably patch the CMake files to make it work, but is there a reason you are building shared rather than static libraries (it should just work with static libraries)?

@hadim
Copy link
Member Author

hadim commented Dec 29, 2020

Trying to build with static now

@hadim
Copy link
Member Author

hadim commented Dec 29, 2020

Osx and linux are fine (only the tests fail due to static lib). I don't know what's wrong with win.

@SimonBoothroyd
Copy link
Contributor

Hmm taking a look now.

@SimonBoothroyd
Copy link
Contributor

SimonBoothroyd commented Dec 29, 2020

@hadim the test failures seem to be just caused by syntax issues in the meta.yaml. I think changing them to something more like:

    - if not exist "%LIBRARY_INC%\\gk_arch.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\gk_defs.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\gk_externs.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\gk_getopt.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\GKlib.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\gk_macros.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\gk_mkblas.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\gk_mkmemory.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\gk_mkpqueue2.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\gk_mkpqueue.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\gk_mkrandom.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\gk_mksort.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\gk_mkutils.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\gk_proto.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\gkregex.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\gk_struct.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\gk_types.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\ms_inttypes.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\ms_stat.h" exit 1  # [win]
    - if not exist "%LIBRARY_INC%\\ms_stdint.h" exit 1  # [win]
    - if not exist "%LIBRARY_LIB%\\GKlib.lib" exit 1  # [win]
    - if not exist "%LIBRARY_BIN%\\cmpnbrs.exe" exit 1  # [win]
    - if not exist "%LIBRARY_BIN%\\csrcnv.exe" exit 1  # [win]
    - if not exist "%LIBRARY_BIN%\\fis.exe" exit 1  # [win]
    - if not exist "%LIBRARY_BIN%\\gkgraph.exe" exit 1  # [win]
    - if not exist "%LIBRARY_BIN%\\gkrw.exe" exit 1  # [win]
    - if not exist "%LIBRARY_BIN%\\m2mnbrs.exe" exit 1  # [win]

should fix them.

@hadim
Copy link
Member Author

hadim commented Dec 31, 2020

LGTM here.

@SimonBoothroyd
Copy link
Contributor

Great - thanks for fixing those @hadim! Feel free to add me as a recipe maintainer also.

@SimonBoothroyd
Copy link
Contributor

SimonBoothroyd commented Dec 31, 2020

@conda-forge/staged-recipes, ready for review

@hadim
Copy link
Member Author

hadim commented Jan 2, 2021

@conda-forge/help-c-cpp please review

-DCMAKE_PREFIX_PATH=$PREFIX \
-DDEBUG=OFF \
-DOPENMP=set \
-DBUILD_SHARED_LIBS=OFF \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conda-forge has a strong preference for shared libraries to make it easier to manage updates and migrations for new ABIs (it also makes license compliance simplier).

Is it practical here? Or is there a reason to why static linking is really needed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be practical on linux + OSX, but currently not on WIN as the __dllexport/__dllimport statements have not been properly set-up.

Should we package shared libraries for linux + OSX and static for WIN, or is it preferable to be consistent and keep everything static until everything can be built as shared?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep as much as shared as possible. You should get a working shared library on Windows by setting cmake -D CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xhochy unfortunately the built binaries rely on a couple of global constants so CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS won't directly work here without patching.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, amazing! CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS hasn't failed for me before.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shared Unix builds are enabled in 1342d88.

recipes/gklib/meta.yaml Outdated Show resolved Hide resolved
recipes/gklib/meta.yaml Outdated Show resolved Hide resolved
Comment on lines 27 to 32
- ${PREFIX}/bin/cmpnbrs --help # [unix]
- ${PREFIX}/bin/csrcnv --help # [unix]
- ${PREFIX}/bin/fis --help # [unix]
- ${PREFIX}/bin/gkgraph --help # [unix]
- ${PREFIX}/bin/gkrw --help # [unix]
- ${PREFIX}/bin/m2mnbrs --help # [unix]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should be on PATH:

Suggested change
- ${PREFIX}/bin/cmpnbrs --help # [unix]
- ${PREFIX}/bin/csrcnv --help # [unix]
- ${PREFIX}/bin/fis --help # [unix]
- ${PREFIX}/bin/gkgraph --help # [unix]
- ${PREFIX}/bin/gkrw --help # [unix]
- ${PREFIX}/bin/m2mnbrs --help # [unix]
- cmpnbrs --help # [unix]
- csrcnv --help # [unix]
- fis --help # [unix]
- gkgraph --help # [unix]
- gkrw --help # [unix]
- m2mnbrs --help # [unix]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops thanks! Fixed by 38bf7b6

@@ -11,7 +11,8 @@ source:

build:
number: 0
# skip: true # [win]
run_exports: # [not win]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would also need to apply the selector to the pin_subpackage line as well though I'd suggest just removing them instead:

Suggested change
run_exports: # [not win]
run_exports:

(it will cause there to be a pointless dependency installed but it doesn't really matter and it has the benifit of tracking the ABI still)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok that makes sense - fixed by 38bf7b6.

- if not exist "%LIBRARY_INC%\\ms_stat.h" exit 1 # [win]
- if not exist "%LIBRARY_INC%\\ms_stdint.h" exit 1 # [win]
- if not exist "%LIBRARY_LIB%\\GKlib.lib" exit 1 # [win]
- if not exist "%LIBRARY_BIN%\\cmpnbrs.exe" exit 1 # [win]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be executed with --help as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently they can! Fixed by 38bf7b6.

@chrisburr chrisburr merged commit aa8c463 into conda-forge:master Jan 7, 2021
@hadim hadim deleted the gklib branch January 7, 2021 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants