.. _install_cmake_mac:
-macOS Specifics
-^^^^^^^^^^^^^^^
+macOS-specific instructions
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
SimGrid compiles like a charm with clang (version 3.0 or higher) on macOS:
.. _install_cmake_windows:
-Windows Specifics
-^^^^^^^^^^^^^^^^^
+Windows-specific instructions
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The best solution to get SimGrid working on windows is to install the
Ubuntu subsystem of Windows 10. All of SimGrid (but the model-checker)
but this is of rather low priority for us. It it's important for you
and if you get it working, please @ref community_contact "tell us".
-Java Specifics
-^^^^^^^^^^^^^^
+Python-specific instructions
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Recompiling the python bindings from the source should be as easy as:
+
+.. code-block:: shell
+
+ # cd simgrid-source-tree
+ python setup.py build install
+
+Starting with SimGrid 3.13, it should even be possible to install
+simgrid without downloading the source with pip:
+
+.. code-block:: shell
+
+ pip install simgrid
+
+Java-specific instructions
+^^^^^^^^^^^^^^^^^^^^^^^^^^
Once you have the `full JDK <http://www.oracle.com/technetwork/java/javase/downloads>`_ installed,
things should be as simple as:
.. code-block:: shell
- cmake -Denable_java=ON .
+ cmake -Denable_java=ON -Dminimal-bindings=ON .
make simgrid-java_jar # Only build the jarfile
After the compilation, the file ```simgrid.jar``` is produced in the
Note that the filename ```jni.h``` was removed from the path.
-Linux Multi-Arch Specifics
-^^^^^^^^^^^^^^^^^^^^^^^^^^
+Linux Multi-Arch specific instructions
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
On a multiarch x86_64 Linux, it should be possible to compile a 32-bit
version of SimGrid with something like:
--- /dev/null
+
+
+# python3 setup.py sdist # Build a source distrib (building binary distribs is complex on linux)
+
+# twine upload --repository-url https://test.pypi.org/legacy/ dist/simgrid-*.tar.gz # Upload to test
+# pip3 install --user --index-url https://test.pypi.org/simple simgrid
+
+# Once it works, upload to the real infra. /!\ you cannot modify a file once uploaded
+# twine upload dist/simgrid-*.tar.gz
+
+import os
+import re
+import sys
+import platform
+import subprocess
+
+from setuptools import setup, Extension
+from setuptools.command.build_ext import build_ext
+from distutils.version import LooseVersion
+
+
+class CMakeExtension(Extension):
+ def __init__(self, name, sourcedir=''):
+ Extension.__init__(self, name, sources=[])
+ self.sourcedir = os.path.abspath(sourcedir)
+
+
+class CMakeBuild(build_ext):
+ def run(self):
+ try:
+ out = subprocess.check_output(['cmake', '--version'])
+ except OSError:
+ raise RuntimeError("CMake must be installed to build the following extensions: " +
+ ", ".join(e.name for e in self.extensions))
+ if not os.path.exists("MANIFEST.in"):
+ raise RuntimeError("Please generate a MANIFEST.in file (configure simgrid, and copy it here if you build out of tree)")
+
+ if platform.system() == "Windows":
+ cmake_version = LooseVersion(re.search(r'version\s*([\d.]+)', out.decode()).group(1))
+ if cmake_version < '3.1.0':
+ raise RuntimeError("CMake >= 3.1.0 is required on Windows")
+
+ for ext in self.extensions:
+ self.build_extension(ext)
+
+ def build_extension(self, ext):
+ extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name)))
+ cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
+ '-DPYTHON_EXECUTABLE=' + sys.executable,
+ '-Denable_smpi=OFF',
+ '-Denable_java=OFF',
+ '-Denable_python=ON',
+ '-Dminimal-bindings=ON']
+
+ cfg = 'Debug' if self.debug else 'Release'
+ build_args = ['--config', cfg]
+
+ if platform.system() == "Windows":
+ cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(cfg.upper(), extdir)]
+ if sys.maxsize > 2**32:
+ cmake_args += ['-A', 'x64']
+ build_args += ['--', '/m']
+ else:
+ cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]
+ build_args += ['--', '-j4']
+
+ env = os.environ.copy()
+ env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get('CXXFLAGS', ''),
+ self.distribution.get_version())
+ if not os.path.exists(self.build_temp):
+ os.makedirs(self.build_temp)
+ subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
+ subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
+
+setup(
+ name='simgrid',
+ version='3.22.2',
+ author='Da SimGrid Team',
+ author_email='simgrid-devel@lists.gforge.inria.fr',
+ description='Toolkit for scalable simulation of distributed applications',
+ long_description=("SimGrid is a scientific instrument to study the behavior of "
+ "large-scale distributed systems such as Grids, Clouds, HPC or P2P "
+ "systems. It can be used to evaluate heuristics, prototype applications "
+ "or even assess legacy MPI applications."),
+ ext_modules=[CMakeExtension('simgrid')],
+ cmdclass=dict(build_ext=CMakeBuild),
+ zip_safe=False,
+ classifiers=[
+ "Development Status :: 4 - Beta",
+ "Environment :: Console",
+ "Intended Audience :: Education",
+ "Intended Audience :: Developers",
+ "Intended Audience :: Science/Research",
+ "Intended Audience :: System Administrators",
+ "License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)",
+ "Operating System :: POSIX",
+ "Operating System :: MacOS",
+ "Operating System :: Microsoft :: Windows",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: C++",
+ "Programming Language :: C",
+ "Programming Language :: Fortran",
+ "Programming Language :: Java",
+ "Topic :: System :: Distributed Computing",
+ "Topic :: System :: Systems Administration",
+ ],
+ url="https://simgrid.org",
+ project_urls={
+ 'Tracker': 'https://framagit.org/simgrid/simgrid/issues/',
+ 'Source': 'https://framagit.org/simgrid/simgrid/',
+ 'Documentation': 'https://simgrid.org/doc/latest/',
+ },
+)