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

bugfix: change linker flag option for mac builds of charm4py #3797

Merged
merged 5 commits into from
May 2, 2024

Conversation

ericjbohm
Copy link
Contributor

Address buildold issue for libcharm as used by charm4py on Darwin

@ericjbohm ericjbohm requested a review from ritvikrao March 27, 2024 22:27
@ericjbohm ericjbohm self-assigned this Mar 27, 2024
@ericjbohm ericjbohm added MacOS Charm4py Issues affecting the integration with Charm4py Buildold The old non-CMake build system. labels Mar 27, 2024
Copy link
Contributor

@ritvikrao ritvikrao left a comment

Choose a reason for hiding this comment

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

This workaround only allows charm++ to build if I comment out a couple of lines in setup/scripts/configure.ac that blocks charm4py build. I added that commit. But even then, now I get an error when running setup.py in charm4py, saying that there's no CmiCommitId in the library file.

Traceback (most recent call last):
  File "/Users/ritvik/charm4py/setup.py", line 311, in <module>
    setuptools.setup(
  File "/usr/local/lib/python3.11/site-packages/setuptools/__init__.py", line 107, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/usr/local/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python3.11/site-packages/setuptools/dist.py", line 1233, in run_command
    super().run_command(command)
  File "/usr/local/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/Users/ritvik/charm4py/setup.py", line 212, in run
    install.run(self)
  File "/usr/local/lib/python3.11/site-packages/setuptools/command/install.py", line 82, in run
    orig.install.run(self)
  File "/usr/local/lib/python3.11/site-packages/setuptools/_distutils/command/install.py", line 697, in run
    self.run_command('build')
  File "/usr/local/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python3.11/site-packages/setuptools/dist.py", line 1233, in run_command
    super().run_command(command)
  File "/usr/local/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 131, in run
    self.run_command(cmd_name)
  File "/usr/local/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python3.11/site-packages/setuptools/dist.py", line 1233, in run_command
    super().run_command(command)
  File "/usr/local/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/Users/ritvik/charm4py/setup.py", line 233, in run
    build_libcharm(os.path.join(os.getcwd(), 'charm_src'), self.build_lib)
  File "/Users/ritvik/charm4py/setup.py", line 175, in build_libcharm
    check_libcharm_version(charm_src_dir)
  File "/Users/ritvik/charm4py/setup.py", line 92, in check_libcharm_version
    commit_id_str = ctypes.c_char_p.in_dll(lib, "CmiCommitID").value.decode()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: dlsym(0x7ff91e454770, CmiCommitID): symbol not found

@ritvikrao
Copy link
Contributor

On macs, the flag for linking whole archives is different than with linux, so I had to change the flag in CMakeLists.

@ritvikrao ritvikrao changed the title bugfix: use CMK_SHARED_SUF instead of a hardcoded .so bugfix: change linker flag option for mac builds of charm4py Mar 31, 2024
@ritvikrao ritvikrao self-assigned this Mar 31, 2024
@ritvikrao ritvikrao requested review from adityapb and ZwFink April 29, 2024 17:22
@ritvikrao
Copy link
Contributor

sending this message to get more eyes on it; it's a trivial flag change for darwin

Copy link
Contributor

@matthiasdiener matthiasdiener left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! (besides the (unrelated?) CI errors)

@ritvikrao ritvikrao merged commit 56ca52a into main May 2, 2024
23 checks passed
@ritvikrao ritvikrao deleted the ericbohm/fix_makefile_for_libcharm branch June 20, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Buildold The old non-CMake build system. Charm4py Issues affecting the integration with Charm4py MacOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants