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

Biogeme #26374

Open
wants to merge 53 commits into
base: main
Choose a base branch
from
Open

Biogeme #26374

wants to merge 53 commits into from

Conversation

FGarridoV
Copy link

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.
  • Package does not ship static libraries. If static libraries are needed, follow CFEP-18.
  • 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.
  • When in trouble, please check our knowledge base documentation before pinging a team.

@conda-forge-webservices
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/biogeme, recipes/biogeme-optimization, recipes/cythonbiogeme) and found it was in an excellent condition.

@conda-forge-webservices
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/biogeme) and found it was in an excellent condition.

- scipy >=1.7.3
- tqdm >=4.64.1
- tomlkit >=0.11.5
- cythonbiogeme ==1.0.2
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not present on conda forge, afaik. You should include a recipe for it in this PR also.

- tqdm >=4.64.1
- tomlkit >=0.11.5
- cythonbiogeme ==1.0.2
- biogeme-optimization ==0.0.5
Copy link
Contributor

Choose a reason for hiding this comment

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

Also this one. So you need three recipes in this PR.

home: http://biogeme.epfl.ch
summary: Estimation and application of discrete choice models
license: MIT
license_family: MIT
Copy link
Contributor

Choose a reason for hiding this comment

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

This license does not seem to be MIT: https://github.com/michelbierlaire/biogeme/blob/master/LICENSE

It seems to be a modification of the MIT license. I'm not sure we can actually distribute this package, given the license.

Copy link
Contributor

Choose a reason for hiding this comment

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

MIT license:

Copyright (c) <year> <copyright holders>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

License found in biogeme:

BIOGEME is distributed free of charge. We ask each user to register to
Biogeme's users group, and to mention explicitly the use of the
package when publishing results, using the following reference:

For BisonBiogeme: Bierlaire, M. (2003). BIOGEME: A free package for
the estimation of discrete choice models , Proceedings of the 3rd
Swiss Transportation Research Conference, Ascona, Switzerland.

For PythonBiogeme: Bierlaire, M. (2016) PythonBiogeme: a short
introduction. Report TRANSP-OR 160706 ,Series on Biogeme. Transport
and Mobility Laboratory, School of Architecture, Civil and
Environmental Engineering, Ecole Polytechnique Fédérale de Lausanne,
Switzerland.

Disclaimer: This software is provided free of charge and "AS IS"
WITHOUT ANY WARRANTY of any kind. The implied warranties of
merchantability, fitness for a particular purpose and non-infringment
are expressly disclaimed. In no event will the author (Michel
Bierlaire) or his employer (EPFL) be liable to any party for any
direct, indirect, special or other consequential damages for any use
of the code including, without limitation, any lost profits, business
interruption, loss of programs or other data on your information
handling system or otherwise, even if we are expressly advised of the
possibility of such damages.

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove license and license_family since this is not the MIT license.

@conda-forge-webservices
Copy link

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

I wanted to let you know that I linted all conda-recipes in your PR (recipes/biogeme, recipes/biogeme-optimization, recipes/cythonbiogeme) and found some lint.

Here's what I've got...

For recipes/biogeme:

  • There are too few lines. There should be one empty line at the end of the file.

For recipes/biogeme-optimization:

  • There are too few lines. There should be one empty line at the end of the file.

For recipes/cythonbiogeme:

  • There are too few lines. There should be one empty line at the end of the file.

@conda-forge-webservices
Copy link

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

I wanted to let you know that I linted all conda-recipes in your PR (recipes/biogeme, recipes/biogeme-optimization, recipes/cythonbiogeme) and found some lint.

Here's what I've got...

For recipes/biogeme:

  • There are too few lines. There should be one empty line at the end of the file.

For recipes/cythonbiogeme:

  • There are too few lines. There should be one empty line at the end of the file.

@conda-forge-webservices
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/biogeme, recipes/biogeme-optimization, recipes/cythonbiogeme) and found it was in an excellent condition.

sha256: f139342944c849b47ce5aaa548e68aa179c195de93ab76be78353f4309684d0e

build:
number: 3
Copy link
Contributor

Choose a reason for hiding this comment

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

Build number should start at 0.

summary: Various optimization algorithms for teaching and research
license: MIT
license_family: MIT
license_file: LICENSE.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the error from the linux build:

ValueError: License file given in about/license_file (/home/conda/staged-recipes-copy/recipes/biogeme-optimization/LICENSE.txt) does not exist in source root dir or in recipe root dir (with meta.yaml)

Copy link
Contributor

Choose a reason for hiding this comment

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

There is no license file in the source tarball for this package. In fact, there is no evidence of a license in the repo at all: https://github.com/michelbierlaire/optimization

If there is no license at all, I don't think we can add this to conda forge because no permission to redistribute is given. Maybe you can open an issue on the author's repository and ask if he will grant permission or add an OSS license to the repository.

@moorepants
Copy link
Contributor

cythonbiogeme osx failure:

  In file included from /Users/runner/Miniforge3/conda-bld/cythonbiogeme_1716277750463/_build_env/bin/../include/c++/v1/__mbstate_t.h:45:
  /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/sys/_types/_mbstate_t.h:31:9: error: unknown type name '__darwin_mbstate_t'
  typedef __darwin_mbstate_t mbstate_t;
          ^
  1 error generated.
  error: command '/Users/runner/Miniforge3/conda-bld/cythonbiogeme_1716277750463/_build_env/bin/clang++' failed with exit code 1
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

summary: C++ part of the Biogeme package
license: MIT
license_family: MIT
license_file: LICENSE.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

Windows build error:

ValueError: License file given in about/license_file (D:\a\1\s\recipes\cythonbiogeme\LICENSE.txt) does not exist in source root dir or in recipe root dir (with meta.yaml)

summary: C++ part of the Biogeme package
license: MIT
license_family: MIT
license_file: LICENSE.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
license_file: LICENSE.txt
license_file: LICENSE


build:
number: 3
script: /bin/rm -f pyproject.toml && {{ PYTHON }} -m pip install . -vv # [unix]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
script: /bin/rm -f pyproject.toml && {{ PYTHON }} -m pip install . -vv # [unix]
script: {{ PYTHON }} -m pip install . -vv

Should be able to keep pyproject.toml and this should run on windows too (at least to start to see if we need a special script.

build:
number: 3
script: /bin/rm -f pyproject.toml && {{ PYTHON }} -m pip install . -vv # [unix]
skip: true # [python_impl == 'pypy']
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this line, we'll see if it runs on pypy later.

- pip
run:
- python
- cython >=0.29.16
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't need this a run dependency, remove.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nevermind I see it in the setup.cfg:

install_requires =
cython >= 0.29.16
pandas >= 1.3.5

Does the package compile things at run time?

@moorepants
Copy link
Contributor

cythonbiogeme builds for me locally on linux with the suggested changes I made above.

@FGarridoV
Copy link
Author

Windows failed with:

Warning: failed to download source.  If building, will try again after downloading recipe dependencies.
Error was: 
Command '['C:\\Miniforge\\Library\\usr\\bin\\patch.exe', '--no-backup-if-mismatch', '--batch', '-Np0', '-i', 'C:\\Users\\VSSADM~1\\AppData\\Local\\Temp\\tmpesbxypun\\setup.cfg.patch.native', '--binary', '--dry-run']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "D:\a\1\s\.ci_support\build_all.py", line 261, in <module>
    build_all(os.path.join(root_dir, "recipes"), args.arch)
  File "D:\a\1\s\.ci_support\build_all.py", line 151, in build_all
    build_folders(recipes_dir, folders, arch, channel_urls)
  File "D:\a\1\s\.ci_support\build_all.py", line 207, in build_folders
    conda_build.api.build([recipe], config=get_config(arch, channel_urls))
  File "C:\Miniforge\lib\site-packages\conda_build\api.py", line 250, in build
    return build_tree(
  File "C:\Miniforge\lib\site-packages\conda_build\build.py", line 3638, in build_tree
    packages_from_this = build(
  File "C:\Miniforge\lib\site-packages\conda_build\build.py", line 2419, in build
    try_download(m, no_download_source=False, raise_error=True)
  File "C:\Miniforge\lib\site-packages\conda_build\render.py", line 779, in try_download
    raise RuntimeError(
RuntimeError: Failed to download or patch source. Please see build log for info.

Make to properly prepare the patch files (google how to do it).

@moorepants I tried different things. Unfortunately, I cannot compile it for win. Any suggestion in what I should look for? as I am not very familiar with these process, I don't know what is exactly the problem I am facing? E.g., How can I see if the new win compiler we are using is the same as the one used by Michael?

@moorepants
Copy link
Contributor

moorepants commented Jun 13, 2024

If the patch doesn't apply then you have a malformed patch file. Until you apply the patch we can't see what compiler errors occur.

@FGarridoV
Copy link
Author

If the patch doesn't apply then you have a malformed patch file. Until you apply the patch we can't see what compiler errors occur.

Below is what I am getting if I use the patch file you sent me. This: Hunk #1 succeeded at 108 with fuzz 1. means that the patch is not malformed?

Applying patch: D:\a\1\s\recipes\cythonbiogeme\setup.cfg.patch
Applying patch: D:\a\1\s\recipes\cythonbiogeme\setup.cfg.patch with args:
['-Np0', '-i', 'C:\\Users\\VSSADM~1\\AppData\\Local\\Temp\\tmphmxluwqt\\setup.cfg.patch.native', '--binary']
checking file setup.cfg
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 108 with fuzz 1.
patching file setup.cfg
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 108 with fuzz 1.

Are these the type of error we are looking for?

ERROR: Could not build wheels for cythonbiogeme, which is required to install pyproject.toml-based projects
Exception information:
Traceback (most recent call last):
  File "%PREFIX%\lib\site-packages\pip\_internal\cli\base_command.py", line 180, in exc_logging_wrapper
    status = run_func(*args)
  File "%PREFIX%\lib\site-packages\pip\_internal\cli\req_command.py", line 245, in wrapper
    return func(self, options, args)
  File "%PREFIX%\lib\site-packages\pip\_internal\commands\install.py", line 429, in run
    raise InstallationError(
pip._internal.exceptions.InstallationError: Could not build wheels for cythonbiogeme, which is required to install pyproject.toml-based projects
Removed build tracker: 'C:\\Users\\VssAdministrator\\AppData\\Local\\Temp\\pip-build-tracker-vtun2a9j'
Traceback (most recent call last):
  File "D:\a\1\s\.ci_support\build_all.py", line 261, in <module>
    build_all(os.path.join(root_dir, "recipes"), args.arch)
  File "D:\a\1\s\.ci_support\build_all.py", line 151, in build_all
    build_folders(recipes_dir, folders, arch, channel_urls)
  File "D:\a\1\s\.ci_support\build_all.py", line 207, in build_folders
    conda_build.api.build([recipe], config=get_config(arch, channel_urls))
  File "C:\Miniforge\lib\site-packages\conda_build\api.py", line 250, in build
    return build_tree(
  File "C:\Miniforge\lib\site-packages\conda_build\build.py", line 3638, in build_tree
    packages_from_this = build(
  File "C:\Miniforge\lib\site-packages\conda_build\build.py", line 2462, in build
    windows.build(
  File "C:\Miniforge\lib\site-packages\conda_build\windows.py", line 339, in build
    check_call_env(
  File "C:\Miniforge\lib\site-packages\conda_build\utils.py", line 405, in check_call_env
    return _func_defaulting_env_to_os_environ("call", *popenargs, **kwargs)
  File "C:\Miniforge\lib\site-packages\conda_build\utils.py", line 381, in _func_defaulting_env_to_os_environ
    raise subprocess.CalledProcessError(proc.returncode, _args)
subprocess.CalledProcessError: Command '['cmd.exe', '/d', '/c', 'conda_build.bat']' returned non-zero exit status 1.
##[error]Cmd.exe exited with code '1'.
Finishing: Build recipes

@moorepants
Copy link
Contributor

The error you copy above is from the latest build and it shows a compile failure with the MSVC compiler (the default for conda forge builds). If you want to use the suggested compile flags in the cythonbiogeme source code, those flags only work with the mingw compiler (which you can enable in the conda forge build). So the flags have to match the compiler you select. We do not have the correct flags for MSVC because the cythonbiogeme author has never successfully built the package with MSVC and does not have suggested flags for it in the source code (or any build instructions). See the related issues posted in the cythonbiogeme github issue tracker.

So you have two paths:

  1. Use the mingw compiler on windows and the compiler flags suggested by the package author.
  2. Use the MSVC compiler and figure out the flags needed for it to compile.

I just noticed that you are using a mix of MSVC and mingw compilers in the current build. You will need to make both the c and C+ compilers be from the same compiler toolset (MSVC or mingw).

For 1 or 2 you will need to patch the setup.cfg file to have the appropriate flags on windows. That patch file must be a properly formed binary unix patch file. Many of the errors we've seen here are that the patch can't be applied (maybe you are trying to edit it in a text editor?). If the patch applies, then we will see whether it compiles or not and get some info from the compiler errors.

So the steps are chose 1 or 2 (not both), make the patch, and then see if it compiles. If you personally use a Windows computer you can try to compile the software on your own computer using this recipe and you can iterate much faster than waiting on the CI in this pull request. I recommend that if you are using Windows.

@moorepants
Copy link
Contributor

Use mingw:

requirements:
  build:
    - {{ compiler('c') }}  # [not win]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('cxx') }}  # [not win]
    - {{ compiler('m2w64_cxx') }}  # [win]
    - {{ stdlib("c") }}

Use MSVC:

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - {{ stdlib("c") }}

@moorepants
Copy link
Contributor

Below is what I am getting if I use the patch file you sent me.

My patch files works, but you seem to be editing the patch file and then it breaks. If you want to create a patch file yourself, then you need to do it using the diff command and use the proper steps.

@moorepants
Copy link
Contributor

Looks like you'll need this change too:

- {{ stdlib("c") }}  # [not win]
 - {{ stdlib("m2w64_c") }}  # [win]

@FGarridoV
Copy link
Author

Looks like you'll need this change too:

- {{ stdlib("c") }}  # [not win]
 - {{ stdlib("m2w64_c") }}  # [win]

I have this now:

requirements:
  build:
    - {{ compiler('c') }}  # [not win]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('cxx') }}  # [not win]
    - {{ compiler('m2w64_cxx') }}  # [win]
    - {{ stdlib("c") }}

@moorepants
Copy link
Contributor

You need dual stdlib calls for win and not win.

@moorepants
Copy link
Contributor

I noticed that most R recipes (e.g. https://github.com/conda-forge/r-seurat-feedstock/blob/2f3707d1e1d539199051a766ac6645d8a143de9e/recipe/meta.yaml#L3) have:

{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

at the top of the file when using mingw.

@moorepants
Copy link
Contributor

But that just looks like a way to install some unix tools: https://github.com/conda-forge/r-seurat-feedstock/blob/2f3707d1e1d539199051a766ac6645d8a143de9e/recipe/meta.yaml#L82

So probably not needed.

@moorepants
Copy link
Contributor

Here is a python cython based install that uses mingw: https://github.com/conda-forge/pyreadr-feedstock/blob/6d08f1b553882341a0ec7c14fe9bd198afdbf7c0/recipe/meta.yaml

It has a couple things:

requirements:
  build:
    - python                                 # [build_platform != target_platform]
    - cross-python_{{ target_platform }}     # [build_platform != target_platform]
    - cython                                 # [build_platform != target_platform]
    - {{ compiler("m2w64_c") }}  # [win]
    - {{ compiler('c') }}  # [not win]
  host:
    - python
    - pip
    - cython
    - m2w64-toolchain  # [win]
    - libpython  # [win]
    - bzip2  # [not win]
    - zlib
  run:
    - python
    - pandas
    - m2w64-gcc-libs  # [win]
    - bzip2  # [not win]

It is possible we need the m2w64-toolchain # [win], m2w64-gcc-libs # [win] also. Not sure though.

@moorepants
Copy link
Contributor

Maybe also helpful from pyreader: https://github.com/ofajardo/pyreadr/blob/master/windows_compilation.md

@moorepants
Copy link
Contributor

Something about mingw and pthread (which we need): conda-forge/conda-forge.github.io#2045 maybe relevant.

@moorepants
Copy link
Contributor

@moorepants
Copy link
Contributor

The lastest build is a patch application failure:

Applying patch: D:\a\1\s\recipes\cythonbiogeme\setup.cfg.patch
Applying patch: D:\a\1\s\recipes\cythonbiogeme\setup.cfg.patch with args:
['-Np0', '-i', 'C:\\Users\\VSSADM~1\\AppData\\Local\\Temp\\tmpymywpvsm\\setup.cfg.patch.native', '--binary']
checking file setup.cfg
Hunk #1 FAILED at 33.
Hunk #2 FAILED at 110.
2 out of 2 hunks FAILED
Warning: failed to download source.  If building, will try again after downloading recipe dependencies.
Error was: 
Command '['C:\\Miniforge\\Library\\usr\\bin\\patch.exe', '--no-backup-if-mismatch', '--batch', '-Np0', '-i', 'C:\\Users\\VSSADM~1\\AppData\\Local\\Temp\\tmpymywpvsm\\setup.cfg.patch.native', '--binary', '--dry-run']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "D:\a\1\s\.ci_support\build_all.py", line 261, in <module>
    build_all(os.path.join(root_dir, "recipes"), args.arch)
  File "D:\a\1\s\.ci_support\build_all.py", line 151, in build_all
    build_folders(recipes_dir, folders, arch, channel_urls)
  File "D:\a\1\s\.ci_support\build_all.py", line 207, in build_folders
    conda_build.api.build([recipe], config=get_config(arch, channel_urls))
  File "C:\Miniforge\lib\site-packages\conda_build\api.py", line 250, in build
    return build_tree(
  File "C:\Miniforge\lib\site-packages\conda_build\build.py", line 3638, in build_tree
    packages_from_this = build(
  File "C:\Miniforge\lib\site-packages\conda_build\build.py", line 2419, in build
    try_download(m, no_download_source=False, raise_error=True)
  File "C:\Miniforge\lib\site-packages\conda_build\render.py", line 779, in try_download
    raise RuntimeError(
RuntimeError: Failed to download or patch source. Please see build log for info

@moorepants
Copy link
Contributor

Maybe relevant: conda-forge/conda-forge.github.io#1891

@moorepants
Copy link
Contributor

Latest Windows error:

"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\bld\cythonbiogeme_1718376474324\_h_env\libs /LIBPATH:C:\bld\cythonbiogeme_1718376474324\_h_env /LIBPATH:C:\bld\cythonbiogeme_1718376474324\_h_env\PCbuild\amd64 "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64" /LIBPATH:C:\bld\cythonbiogeme_1718376474324\_h_env\Library\lib /EXPORT:PyInit_cythonbiogeme build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioDerivatives.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExceptions.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprAnd.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprBelongsTo.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprConditionalSum.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprCos.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprDerive.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprDivide.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprDraws.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprElem.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprEqual.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprExp.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprFixedParameter.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprFreeParameter.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprGaussHermite.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprGreater.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprGreaterOrEqual.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprIntegrate.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLess.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLessOrEqual.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLinearUtility.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLiteral.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLog.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLogLogit.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLogLogitFullChoiceSet.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLogzero.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprMax.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprMin.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprMinus.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprMontecarlo.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprMultSum.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprNormalCdf.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprNotEqual.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprNumeric.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprOr.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprPanelTrajectory.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprPlus.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprPower.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprRandomVariable.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprSin.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprTimes.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprUnaryMinus.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprVariable.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExpression.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioFormula.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioGaussHermite.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioGhFunction.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioMemoryManagement.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioNormalCdf.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioSeveralExpressions.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioSeveralFormulas.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioString.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioThreadMemory.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioThreadMemoryOneExpression.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioThreadMemorySimul.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioVectorOfDerivatives.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/biogeme.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/cythonbiogeme.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/evaluateExpressions.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/validity_check.obj /OUT:build\lib.win-amd64-cpython-310\cythonbiogeme\cythonbiogeme.cp310-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp\cythonbiogeme.cp310-win_amd64.lib
     Creating library build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp\cythonbiogeme.cp310-win_amd64.lib and object build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp\cythonbiogeme.cp310-win_amd64.exp
  biogeme.obj : error LNK2001: unresolved external symbol __imp_pthread_join
  biogeme.obj : error LNK2001: unresolved external symbol __imp_pthread_create
  build\lib.win-amd64-cpython-310\cythonbiogeme\cythonbiogeme.cp310-win_amd64.pyd : fatal error LNK1120: 2 unresolved externals
  error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.40.33807\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120
  error: subprocess-exited-with-error

Two things:

  1. It is compiling with MSVC not mingw, so we are missing something to trigger it to use mingw.
  2. MSVC fails because pthreads is not available for linking.

Two solution paths: 1) figure out how to ensure compilation is with mingw or 2) figure out how to link against pthreads with MSVC.

@FGarridoV
Copy link
Author

FGarridoV commented Jun 14, 2024

Latest Windows error:

"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\bld\cythonbiogeme_1718376474324\_h_env\libs /LIBPATH:C:\bld\cythonbiogeme_1718376474324\_h_env /LIBPATH:C:\bld\cythonbiogeme_1718376474324\_h_env\PCbuild\amd64 "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64" /LIBPATH:C:\bld\cythonbiogeme_1718376474324\_h_env\Library\lib /EXPORT:PyInit_cythonbiogeme build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioDerivatives.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExceptions.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprAnd.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprBelongsTo.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprConditionalSum.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprCos.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprDerive.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprDivide.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprDraws.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprElem.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprEqual.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprExp.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprFixedParameter.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprFreeParameter.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprGaussHermite.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprGreater.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprGreaterOrEqual.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprIntegrate.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLess.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLessOrEqual.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLinearUtility.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLiteral.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLog.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLogLogit.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLogLogitFullChoiceSet.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprLogzero.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprMax.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprMin.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprMinus.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprMontecarlo.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprMultSum.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprNormalCdf.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprNotEqual.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprNumeric.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprOr.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprPanelTrajectory.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprPlus.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprPower.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprRandomVariable.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprSin.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprTimes.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprUnaryMinus.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExprVariable.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioExpression.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioFormula.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioGaussHermite.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioGhFunction.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioMemoryManagement.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioNormalCdf.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioSeveralExpressions.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioSeveralFormulas.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioString.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioThreadMemory.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioThreadMemoryOneExpression.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioThreadMemorySimul.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/bioVectorOfDerivatives.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/biogeme.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/cythonbiogeme.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/evaluateExpressions.obj build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp/validity_check.obj /OUT:build\lib.win-amd64-cpython-310\cythonbiogeme\cythonbiogeme.cp310-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp\cythonbiogeme.cp310-win_amd64.lib
     Creating library build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp\cythonbiogeme.cp310-win_amd64.lib and object build\temp.win-amd64-cpython-310\Release\src/cythonbiogeme/cpp\cythonbiogeme.cp310-win_amd64.exp
  biogeme.obj : error LNK2001: unresolved external symbol __imp_pthread_join
  biogeme.obj : error LNK2001: unresolved external symbol __imp_pthread_create
  build\lib.win-amd64-cpython-310\cythonbiogeme\cythonbiogeme.cp310-win_amd64.pyd : fatal error LNK1120: 2 unresolved externals
  error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.40.33807\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120
  error: subprocess-exited-with-error

Two things:

  1. It is compiling with MSVC not mingw, so we are missing something to trigger it to use mingw.
  2. MSVC fails because pthreads is not available for linking.

Two solution paths: 1) figure out how to ensure compilation is with mingw or 2) figure out how to link against pthreads with MSVC.

I am really not familiar with these topics. I think am acting as guessing. But I have some ideas patching the file to uncomment the setup.cfg marked for windows. So will go now for option 1, as I have no clue for going for option 2.

@moorepants
Copy link
Contributor

I recommend asking for help from the conda forge community and the cythonbiogeme author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants