Skip to content

Commit

Permalink
Remove RTLD_GLOBAL flag from apps. (#2312)
Browse files Browse the repository at this point in the history
* Remove RTLD_GLOBAL flag from apps.

* Set RTLD_GLOBAL in habitat-sim __init__.py.

* Change direct flag set by magnum import, which does the equivalent.

* Pre-commit pass.
  • Loading branch information
0mdc authored Mar 18, 2024
1 parent 3d6d67d commit d890c64
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
5 changes: 0 additions & 5 deletions examples/motion_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

import ctypes
import random
import sys
import time
from typing import Any, Callable, Dict, Optional, Tuple

flags = sys.getdlopenflags()
sys.setdlopenflags(flags | ctypes.RTLD_GLOBAL)

import magnum as mn
from magnum.platform.glfw import Application
from viewer import HabitatSimInteractiveViewer, MouseMode, Timer
Expand Down
5 changes: 0 additions & 5 deletions examples/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

import ctypes
import math
import os
import string
import sys
import time
from enum import Enum
from typing import Any, Callable, Dict, List, Optional, Tuple

flags = sys.getdlopenflags()
sys.setdlopenflags(flags | ctypes.RTLD_GLOBAL)

import magnum as mn
import numpy as np
from magnum import shaders, text
Expand Down
6 changes: 6 additions & 0 deletions src_python/habitat_sim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

import builtins

# Important platform-specific setup steps to do before using bindings.
try:
import magnum
except ImportError:
pass

__version__ = "0.3.1"

if not getattr(builtins, "__HSIM_SETUP__", False):
Expand Down

0 comments on commit d890c64

Please sign in to comment.